[llvm-dev] [LLD] Can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment

Joerg Sonnenberger via llvm-dev llvm-dev at lists.llvm.org
Thu Mar 23 07:14:49 PDT 2017


On Thu, Mar 23, 2017 at 01:23:24PM +0100, Martin Richtarsky via llvm-dev wrote:
> ld: error: rodatareloc.s.o:(.rodata+0x0): can't create dynamic relocation
> R_X86_64_64 against local symbol in readonly segment defined in
> rodatareloc.s.o
> 
> 
> Changing the section from .rodata to .data fixes it, but I guess this
> should be supported also for .rodata. Should I open a bug?

This is not a bug, lld is completely correct. You are explicitly asking
for a read-only section and the choosen relocation is position
dependent, so yes, it correctly bails out.

Joerg


More information about the llvm-dev mailing list