Hi Joachim,

I'd like to extend the ld generated PE section with a custom section called .store in analogy to .idata and I would love a little guidance where to make this change.

I would recommend that rather than doing this in the linker, you
perform it as an additional step after the linking has completed,
using objcopy's --add-section command line option.  This means
that the solution will work with the current tools, and it will
give you a chance to post-process the linked binary to extract
any information that you need to store into the new section.

If you do want to use the linker, then the first place to look
is the linker script ld/scripttemp/pep.sc.  This is where you
should place a definition of the new section.

The new field must be generated after the idata has been generated.

Which as I assume you have discovered is done inside ld/pe-dll.c.


In addition I need to know where the dllname name, foo.dll is generated as I need to change this as well to reserve like 300 more chars for later changes of said dllname.

I am not sure what you mean here, but probably the code you are
looking for is in ld/emultempl/pe.em and/or ld/emultempl/pep.em.
Either there or bfd/peicode.h.

Cheers
  Nick



Reply via email to