Re:A copy-and-patch JIT compiler for CPython
by Retr0id on Tuesday December 26, 2023 @04:58AM
(#38770344)
My first impression is that this sounds clever but also quite fragile, because compilers love to change the minutiae how they emit their relocations between versions or compilation options.
[ Parent
| on HN ]
Re:A copy-and-patch JIT compiler for CPython
by lifthrasiir on Tuesday December 26, 2023 @05:09AM
(#38770387)
The stencil is compiled with a separate tool and checked into the repository, so if the stencil didn't change there is no additional compile issue at all. This also means that the aforementioned tool should be able to resolve all relocations beforehand, and the exact method should be standardized in the ELF spec, so the tool only has to track the ELF spec, not the compiler. (In reality the tool would also do some cleanup jobs that are complier-dependent, of course.)
Re:A copy-and-patch JIT compiler for CPython
by Joker_vD on Tuesday December 26, 2023 @08:01AM
(#38771401)
They emit the relocations into the relocation section(s), clearly marked as such. The only fragility may come from the copy-and-patch compiler not supporting all kinds of relocations that exist for a particular ABI or from the ELF itself changing but those things don't happen very often.