[lld] r345080 - Remove a global variable that is set but not used.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 23 14:00:29 PDT 2018


Author: ruiu
Date: Tue Oct 23 14:00:28 2018
New Revision: 345080

URL: http://llvm.org/viewvc/llvm-project?rev=345080&view=rev
Log:
Remove a global variable that is set but not used.

Modified:
    lld/trunk/ELF/Symbols.cpp
    lld/trunk/ELF/Symbols.h
    lld/trunk/ELF/Writer.cpp

Modified: lld/trunk/ELF/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.cpp?rev=345080&r1=345079&r2=345080&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.cpp (original)
+++ lld/trunk/ELF/Symbols.cpp Tue Oct 23 14:00:28 2018
@@ -39,7 +39,6 @@ Defined *ElfSym::MipsGp;
 Defined *ElfSym::MipsGpDisp;
 Defined *ElfSym::MipsLocalGp;
 Defined *ElfSym::RelaIpltEnd;
-Defined *ElfSym::RISCVGlobalPointer;
 
 static uint64_t getSymVA(const Symbol &Sym, int64_t &Addend) {
   switch (Sym.kind()) {

Modified: lld/trunk/ELF/Symbols.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=345080&r1=345079&r2=345080&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.h (original)
+++ lld/trunk/ELF/Symbols.h Tue Oct 23 14:00:28 2018
@@ -348,9 +348,6 @@ struct ElfSym {
 
   // __rela_iplt_end or __rel_iplt_end
   static Defined *RelaIpltEnd;
-
-  // __global_pointer$ in RISC-V.
-  static Defined *RISCVGlobalPointer;
 };
 
 // A buffer class that is large enough to hold any Symbol-derived

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=345080&r1=345079&r2=345080&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Oct 23 14:00:28 2018
@@ -1560,13 +1560,9 @@ template <class ELFT> void Writer<ELFT>:
   addRelIpltSymbols();
 
   // RISC-V's gp can address +/- 2 KiB, set it to .sdata + 0x800 if not defined.
-  if (Config->EMachine == EM_RISCV) {
-    ElfSym::RISCVGlobalPointer =
-        dyn_cast_or_null<Defined>(Symtab->find("__global_pointer$"));
-    if (!ElfSym::RISCVGlobalPointer)
-      ElfSym::RISCVGlobalPointer =
-          addOptionalRegular("__global_pointer$", findSection(".sdata"), 0x800);
-  }
+  if (Config->EMachine == EM_RISCV)
+    if (!dyn_cast_or_null<Defined>(Symtab->find("__global_pointer$")))
+      addOptionalRegular("__global_pointer$", findSection(".sdata"), 0x800);
 
   // This responsible for splitting up .eh_frame section into
   // pieces. The relocation scan uses those pieces, so this has to be




More information about the llvm-commits mailing list