relocation type suitable for resources

jafa jafa@silicondust.com
Sun Jun 15 09:16:00 GMT 2008


>> 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



More information about the Binutils mailing list