Questions regarding editing an elf executable

2020-06-24 Thread Anastasios Andronidis via Elfutils-devel
Hello everyone, please forgive my rather noob-ish question but I'm very confused on how libelf works. My end goal is to add a DT_NEEDED entry into an arbitrary elf file, but before this I should just print the DT_NEEDED entries like this: ```C // Some code that copies a source_elf_file to a

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

2020-06-24 Thread Anastasios Andronidis via Elfutils-devel
Hello Mark, thanks a billion for you answer! You gave me a very good starting point! Kindly, Anastasios > On 19 Jun 2020, at 21:15, Mark Wielaard wrote: > > Hi, > > On Thu, 2020-06-11 at 15:25 +0100, Anastasios Andronidis via Elfutils- > devel wrote: >> Could som

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

2020-06-11 Thread Anastasios Andronidis via Elfutils-devel
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