HA: [lld] r250584 - [ELF2] - Implemented R_X86_64_PLT32 relocation.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 16 18:42:05 PDT 2015


> От: Hal Finkel [hfinkel at anl.gov]
> Отправлено: 17 октября 2015 г. 4:39
> Кому: George Rimar
> Копия: llvm-commits at lists.llvm.org
> Тема: Re: [lld] r250584 - [ELF2] - Implemented R_X86_64_PLT32 relocation.
> 
> Why is the second parameter (NeedsGot) true here? This will cause a .plt entry to be required for undefined weak symbols even when not compiling with -shared.
> 
> -Hal

With false it breaks the test dynamic-reloc-weak.s, where stated "Both gold and bfd ld will produce a relocation for sym1 and sym2". With false only relocation for sym1 is generated:

  Section (4) .rela.dyn {
    0x120A0 R_X86_64_GLOB_DAT sym1 0x0
  }

so I decided to keep consistency with ld. I also think it is not an issue: 
"A weak undefined reference is like an ordinary undefined reference, except that it is not an error if a
 relocation refers to a weak undefined reference symbol which has no defining symbol. Instead, the relocation is computed as though the symbol had the value zero." (http://www.airs.com/blog/archives/42)


More information about the llvm-commits mailing list