[lld] r324421 - Convert a use of Config->Static.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 6 14:59:24 PST 2018


Author: rafael
Date: Tue Feb  6 14:59:24 2018
New Revision: 324421

URL: http://llvm.org/viewvc/llvm-project?rev=324421&view=rev
Log:
Convert a use of Config->Static.

In lld this was the only use of Config->Static where it meant anything
else other than "use .a instead of .so".

If a program turns out to not use any dynamic libraries, we should
produce the same result with and without -static.

Modified:
    lld/trunk/ELF/Writer.cpp
    lld/trunk/test/ELF/gnu-ifunc-dynsym.s

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=324421&r1=324420&r2=324421&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Feb  6 14:59:24 2018
@@ -837,7 +837,7 @@ void PhdrEntry::add(OutputSection *Sec)
 // need these symbols, since IRELATIVE relocs are resolved through GOT
 // and PLT. For details, see http://www.airs.com/blog/archives/403.
 template <class ELFT> void Writer<ELFT>::addRelIpltSymbols() {
-  if (!Config->Static)
+  if (needsInterpSection())
     return;
   StringRef S = Config->IsRela ? "__rela_iplt_start" : "__rel_iplt_start";
   addOptionalRegular(S, InX::RelaIplt, 0, STV_HIDDEN, STB_WEAK);

Modified: lld/trunk/test/ELF/gnu-ifunc-dynsym.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/gnu-ifunc-dynsym.s?rev=324421&r1=324420&r2=324421&view=diff
==============================================================================
--- lld/trunk/test/ELF/gnu-ifunc-dynsym.s (original)
+++ lld/trunk/test/ELF/gnu-ifunc-dynsym.s Tue Feb  6 14:59:24 2018
@@ -1,7 +1,11 @@
+// REQUIRES: x86
 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
+
 // RUN: ld.lld -static -export-dynamic %t.o -o %tout
 // RUN: llvm-nm -U %tout | FileCheck %s
-// REQUIRES: x86
+
+// RUN: ld.lld -export-dynamic %t.o -o %tout
+// RUN: llvm-nm -U %tout | FileCheck %s
 
 // CHECK: __rela_iplt_end
 // CHECK: __rela_iplt_start




More information about the llvm-commits mailing list