Question on how to copy an elf file and edit the .preinit_array section

Anastasios Andronidis anastasis90@gmail.com
Thu Jun 11 14:25:54 GMT 2020


Hello everyone!

 Could someone please help me with this: https://stackoverflow.com/questions/62293512/inject-a-preinit-array-section-in-an-elf-file-with-libelf

I'm trying to do some runtime manipulation of an elf file and I'm a little bit lost with how to use libelf :/

Basically I want to copy an elf file to a new one and edit .preinit_array section. This is similar to what objcopy --add-section would do, but I only care about the elf headers and using libelf to achieve this.

Kindly,
Anastasios


More information about the Elfutils-devel mailing list