[lld] r249520 - Don't create dynamic relocations for weak undefined symbols.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 6 21:52:39 PDT 2015


On Tue, Oct 6, 2015 at 9:48 PM, Rafael EspĂ­ndola <
llvm-commits at lists.llvm.org> wrote:

> With this change all llvm and clang tests pass when built with lld.
>
> Amusingly the only failures now in check-all are lld's :-)
>

Woohoo!

Is it too early to compare LLD to GNU ld or gold? I assume that LLD
produces much larger executables than those because we don't eliminate
duplicate comdats yet, so the answer is yes. Right? (If we generate larger
executables, it's naturally slower than those because we are handling more
data.)



> On 7 October 2015 at 00:22, Rafael Espindola via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
> > Author: rafael
> > Date: Tue Oct  6 23:22:55 2015
> > New Revision: 249520
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=249520&view=rev
> > Log:
> > Don't create dynamic relocations for weak undefined symbols.
> >
> > Modified:
> >     lld/trunk/ELF/OutputSections.cpp
> >     lld/trunk/test/elf2/dynamic-reloc.s
> >
> > Modified: lld/trunk/ELF/OutputSections.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=249520&r1=249519&r2=249520&view=diff
> >
> ==============================================================================
> > --- lld/trunk/ELF/OutputSections.cpp (original)
> > +++ lld/trunk/ELF/OutputSections.cpp Tue Oct  6 23:22:55 2015
> > @@ -413,7 +413,9 @@ lld::elf2::getLocalSymVA(const typename
> >  bool lld::elf2::canBePreempted(const SymbolBody *Body) {
> >    if (!Body)
> >      return false;
> > -  if (Body->isShared() || Body->isUndefined())
> > +  if (Body->isShared())
> > +    return true;
> > +  if (Body->isUndefined() && !Body->isWeak())
> >      return true;
> >    if (!Config->Shared)
> >      return false;
> >
> > Modified: lld/trunk/test/elf2/dynamic-reloc.s
> > URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/dynamic-reloc.s?rev=249520&r1=249519&r2=249520&view=diff
> >
> ==============================================================================
> > --- lld/trunk/test/elf2/dynamic-reloc.s (original)
> > +++ lld/trunk/test/elf2/dynamic-reloc.s Tue Oct  6 23:22:55 2015
> > @@ -59,4 +59,6 @@
> >  .global _start
> >  _start:
> >  .quad bar + 0x42
> > +.weak foo
> > +.quad foo
> >  call main
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151006/4fab9a8b/attachment-0001.html>


More information about the llvm-commits mailing list