This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: relocation type suitable for resources



The resource section of a windows executable needs offset addresses
relative to the image base (the VMA offset relative to the image VMA
base address).

Aka the rva.


What is the best way to specify that I need a link-time-calculated
"offset from image-base" address that should not result in a run-time
relocation entry?

What you need is reloc type 0x07 that BFD calls BFD_RELOC_RVA (and is displayed in "objdump -j .rsrc -r" as "rva32") and the PE standard calls IMAGE_REL_I386_DIR32NB. You can emit this reloc with the assembler op ".rva <label>".

Brian
Thanks for the explanation - using ".rva" worked.

Objdump confirms the relocation information in the .o file and a resource editor confirms the resulting DLL is well formed.

Thanks again!

Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]