[lld] r249645 - ELF2: Inititalize other symbols only once as well.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 7 17:44:28 PDT 2015
Author: ruiu
Date: Wed Oct 7 19:44:28 2015
New Revision: 249645
URL: http://llvm.org/viewvc/llvm-project?rev=249645&view=rev
Log:
ELF2: Inititalize other symbols only once as well.
Modified:
lld/trunk/ELF/SymbolTable.cpp
lld/trunk/ELF/Symbols.cpp
Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=249645&r1=249644&r2=249645&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Wed Oct 7 19:44:28 2015
@@ -105,8 +105,6 @@ void SymbolTable::addSyntheticSym(String
}
template <class ELFT> void SymbolTable::addIgnoredSym(StringRef Name) {
- DefinedAbsolute<ELFT>::IgnoreUndef.setBinding(STB_WEAK);
- DefinedAbsolute<ELFT>::IgnoreUndef.setVisibility(STV_HIDDEN);
auto Sym = new (Alloc)
DefinedAbsolute<ELFT>(Name, DefinedAbsolute<ELFT>::IgnoreUndef);
resolve<ELFT>(Sym);
Modified: lld/trunk/ELF/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.cpp?rev=249645&r1=249644&r2=249645&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.cpp (original)
+++ lld/trunk/ELF/Symbols.cpp Wed Oct 7 19:44:28 2015
@@ -86,11 +86,17 @@ std::unique_ptr<InputFile> Lazy::getMemb
return createELFFile<ObjectFile>(MBRef);
}
+template <class ELFT> static void doInitSymbols() {
+ DefinedAbsolute<ELFT>::IgnoreUndef.setBinding(STB_WEAK);
+ DefinedAbsolute<ELFT>::IgnoreUndef.setVisibility(STV_HIDDEN);
+ Undefined<ELFT>::Optional.setVisibility(STV_HIDDEN);
+}
+
void lld::elf2::initSymbols() {
- Undefined<ELF32LE>::Optional.setVisibility(STV_HIDDEN);
- Undefined<ELF32BE>::Optional.setVisibility(STV_HIDDEN);
- Undefined<ELF64LE>::Optional.setVisibility(STV_HIDDEN);
- Undefined<ELF64BE>::Optional.setVisibility(STV_HIDDEN);
+ doInitSymbols<ELF32LE>();
+ doInitSymbols<ELF32BE>();
+ doInitSymbols<ELF64LE>();
+ doInitSymbols<ELF64BE>();
}
template int SymbolBody::compare<ELF32LE>(SymbolBody *Other);
More information about the llvm-commits
mailing list