[PATCH] D26133: [ELF] Allow relative relocations to absolute symbols in PIC

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 12 17:02:18 PST 2016


Petr Hosek <phosek at google.com> writes:

> I've made a mistake in my test, the linker script is used as a
> linker-script input file, not as a linker script, so the lld invocation
> should be:
>
> ld.lld -shared --gc-sections -o %t1 %t.script
>
> That still fails with the same error. You cannot assign to . a
> linker-script input file so your solution unfortunately doesn't work. Aside
> from the "provide" semantics, it's the same as if it were an ET_REL input
> file with no sections and just a symbol table entry:

Not sure I follow why you cannot assign to '.'. If that is a limitation
that we have, that might be what we want to change.

> .globl _BASE
> .hidden _BASE
> _BASE = 0
>
> I tried that case as well and lld fails with the same error so it's not an
> issue with linker script handling.

That should fail. That .o file has an ABS symbol, no?

Cheers,
Rafael


More information about the llvm-commits mailing list