[lld] r250101 - [ELF2] Add a base set of PPC64 relocations

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 14 11:47:56 PDT 2015


> It looks like gold and bfd have a funny logic as to when a weak
> undefined shows up in dynamic revocations.
>
> Given
>
>         .globl _start
> _start:
>         .weak sym1
>         .long sym1 at gotpcrel
>         .weak sym2
>         .long sym2 at plt
>         .weak sym3
>         .quad sym3
>
> There will be relocs for sym1 and sym2, but I cannot understand the
> logic. If the dynamic linker must get a chance to look for sym1 and
> sym2, it must also get one for sym3.

And it looks like the answer is that there is no reasonable way to
solve it when a got is not used.

r250311 implements what I think is the correct behavior. With that you
should be able to remove the extra "(S.isUndefined() && S.isWeak())"
in the ppc code. Let me know if anything is missing.

Thanks,
Rafael


More information about the llvm-commits mailing list