[LLVMdev] How to prevent LLVM from emitting R_X86_64_32 ELF relocations?

Yuri yuri at rawbw.com
Fri Apr 26 20:02:27 PDT 2013


On 04/26/2013 19:50, Jiong Wang wrote:
>
>
>   why do you want to prevent R_X86_64_32 generation? for 32bit dwarf, 
> I think generation of R_X86_64_32 is reasonable.
>
>   you can check http://dwarfstd.org/doc/DWARF4.pdf. 

Because R_X86_64_32 elements are 4-byte addresses and can't be relocated 
for the 64-bit address space over 32-bit limit.

Dwarf2 actually allows for both 32bit and 64-bit relocations. The 
document, mentioned by you, explains this in section 7.5.1.1 on page 
143. If the first DWORD of .debug_info section is 0xffffffff, then this 
is 64-bit format.

But LLVM for some reason always chooses DWARF 32-bit format. This is why 
I asked the question. Resulting relocable 64-bit objects can't be loaded 
into addresses that are over 32-bit limit.

Yuri



More information about the llvm-dev mailing list