Re:Compiling C++ with the Clang API
by secondcoming on Monday March 10, 2025 @06:04AM
(#43318717)
I’ve wanted something like this to compile XML business rules to native code on the fly.
I would have a script that converted the XML to C and then turn that into machine code that I’d load directly from the .text section of the binary (shellcode style).
Turns out this is error prone because compilers can emit things like jump tables into the .rodata section, so you need that too. It’s easier to just create a shared library.
I would have a script that converted the XML to C and then turn that into machine code that I’d load directly from the .text section of the binary (shellcode style).
Turns out this is error prone because compilers can emit things like jump tables into the .rodata section, so you need that too. It’s easier to just create a shared library.