[lld] r257507 - Rename IgnoredUndef -> Ignored since it is not an undefined symbol.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 12 11:24:55 PST 2016


Author: ruiu
Date: Tue Jan 12 13:24:55 2016
New Revision: 257507

URL: http://llvm.org/viewvc/llvm-project?rev=257507&view=rev
Log:
Rename IgnoredUndef -> Ignored since it is not an undefined symbol.

Also rename Ignored -> IgnoredWeak and IgnoredStrong -> Ignored,
since strong symbol is a norm.

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

Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=257507&r1=257506&r2=257507&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Tue Jan 12 13:24:55 2016
@@ -120,14 +120,14 @@ SymbolBody *SymbolTable<ELFT>::addSynthe
 // file's symbol table. Such symbols are useful for some linker-defined symbols.
 template <class ELFT>
 SymbolBody *SymbolTable<ELFT>::addIgnored(StringRef Name) {
-  return addAbsolute(Name, ElfSym<ELFT>::IgnoreUndef);
+  return addAbsolute(Name, ElfSym<ELFT>::IgnoredWeak);
 }
 
 // The 'strong' variant of the addIgnored. Adds symbol which has a global
 // binding and cannot be substituted.
 template <class ELFT>
 SymbolBody *SymbolTable<ELFT>::addIgnoredStrong(StringRef Name) {
-  return addAbsolute(Name, ElfSym<ELFT>::IgnoreUndefStrong);
+  return addAbsolute(Name, ElfSym<ELFT>::Ignored);
 }
 
 // Rename SYM as __wrap_SYM. The original symbol is preserved as __real_SYM.

Modified: lld/trunk/ELF/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.cpp?rev=257507&r1=257506&r2=257507&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.cpp (original)
+++ lld/trunk/ELF/Symbols.cpp Tue Jan 12 13:24:55 2016
@@ -120,10 +120,10 @@ std::unique_ptr<InputFile> Lazy::getMemb
 
 template <class ELFT> static void doInitSymbols() {
   ElfSym<ELFT>::End.setBinding(STB_GLOBAL);
-  ElfSym<ELFT>::IgnoreUndef.setBinding(STB_WEAK);
-  ElfSym<ELFT>::IgnoreUndef.setVisibility(STV_HIDDEN);
-  ElfSym<ELFT>::IgnoreUndefStrong.setBinding(STB_GLOBAL);
-  ElfSym<ELFT>::IgnoreUndefStrong.setVisibility(STV_HIDDEN);
+  ElfSym<ELFT>::IgnoredWeak.setBinding(STB_WEAK);
+  ElfSym<ELFT>::IgnoredWeak.setVisibility(STV_HIDDEN);
+  ElfSym<ELFT>::Ignored.setBinding(STB_GLOBAL);
+  ElfSym<ELFT>::Ignored.setVisibility(STV_HIDDEN);
 }
 
 void elf2::initSymbols() {

Modified: lld/trunk/ELF/Symbols.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=257507&r1=257506&r2=257507&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.h (original)
+++ lld/trunk/ELF/Symbols.h Tue Jan 12 13:24:55 2016
@@ -300,11 +300,11 @@ template <class ELFT> struct ElfSym {
   typedef typename llvm::object::ELFFile<ELFT>::Elf_Sym Elf_Sym;
 
   // Used to represent an undefined symbol which we don't want
-  // to add to the output file's symbol table. The `IgnoreUndef`
-  // has weak binding and can be substituted. The `InoreUndefStrong`
-  // has global binding and gets priority over symbols from shared libs.
-  static Elf_Sym IgnoreUndef;
-  static Elf_Sym IgnoreUndefStrong;
+  // to add to the output file's symbol table. The `IgnoredWeak`
+  // has weak binding and can be substituted. The `Ignore` has
+  // global binding and gets priority over symbols from shared libs.
+  static Elf_Sym IgnoredWeak;
+  static Elf_Sym Ignored;
 
   // The content for _end and end symbols.
   static Elf_Sym End;
@@ -318,9 +318,8 @@ template <class ELFT> struct ElfSym {
   static Elf_Sym RelaIpltEnd;
 };
 
-template <class ELFT> typename ElfSym<ELFT>::Elf_Sym ElfSym<ELFT>::IgnoreUndef;
-template <class ELFT>
-typename ElfSym<ELFT>::Elf_Sym ElfSym<ELFT>::IgnoreUndefStrong;
+template <class ELFT> typename ElfSym<ELFT>::Elf_Sym ElfSym<ELFT>::IgnoredWeak;
+template <class ELFT> typename ElfSym<ELFT>::Elf_Sym ElfSym<ELFT>::Ignored;
 template <class ELFT> typename ElfSym<ELFT>::Elf_Sym ElfSym<ELFT>::End;
 template <class ELFT> typename ElfSym<ELFT>::Elf_Sym ElfSym<ELFT>::MipsGp;
 template <class ELFT>

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=257507&r1=257506&r2=257507&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Jan 12 13:24:55 2016
@@ -606,8 +606,8 @@ template <class ELFT> static bool includ
 
   // Don't include synthetic symbols like __init_array_start in every output.
   if (auto *U = dyn_cast<DefinedRegular<ELFT>>(&B))
-    if (&U->Sym == &ElfSym<ELFT>::IgnoreUndef ||
-        &U->Sym == &ElfSym<ELFT>::IgnoreUndefStrong)
+    if (&U->Sym == &ElfSym<ELFT>::IgnoredWeak ||
+        &U->Sym == &ElfSym<ELFT>::Ignored)
       return false;
 
   return true;




More information about the llvm-commits mailing list