[lld] r315141 - Inline small function. NFC.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 6 18:08:28 PDT 2017
Author: rafael
Date: Fri Oct 6 18:08:28 2017
New Revision: 315141
URL: http://llvm.org/viewvc/llvm-project?rev=315141&view=rev
Log:
Inline small function. NFC.
Modified:
lld/trunk/ELF/SymbolTable.cpp
lld/trunk/ELF/SymbolTable.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=315141&r1=315140&r2=315141&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Fri Oct 6 18:08:28 2017
@@ -136,16 +136,6 @@ DefinedRegular *SymbolTable::addAbsolute
return cast<DefinedRegular>(Sym->body());
}
-// Add Name as an "ignored" symbol. An ignored symbol is a regular
-// linker-synthesized defined symbol, but is only defined if needed.
-template <class ELFT>
-DefinedRegular *SymbolTable::addIgnored(StringRef Name, uint8_t Visibility) {
- SymbolBody *S = find(Name);
- if (!S || S->isInCurrentDSO())
- return nullptr;
- return addAbsolute<ELFT>(Name, Visibility);
-}
-
// Set a flag for --trace-symbol so that we can print out a log message
// if a new symbol with the same name is inserted into the symbol table.
void SymbolTable::trace(StringRef Name) {
@@ -871,11 +861,6 @@ template DefinedRegular *SymbolTable::ad
template DefinedRegular *SymbolTable::addAbsolute<ELF64BE>(StringRef, uint8_t,
uint8_t);
-template DefinedRegular *SymbolTable::addIgnored<ELF32LE>(StringRef, uint8_t);
-template DefinedRegular *SymbolTable::addIgnored<ELF32BE>(StringRef, uint8_t);
-template DefinedRegular *SymbolTable::addIgnored<ELF64LE>(StringRef, uint8_t);
-template DefinedRegular *SymbolTable::addIgnored<ELF64BE>(StringRef, uint8_t);
-
template Symbol *
SymbolTable::addLazyArchive<ELF32LE>(StringRef, ArchiveFile *,
const object::Archive::Symbol);
Modified: lld/trunk/ELF/SymbolTable.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.h?rev=315141&r1=315140&r2=315141&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.h (original)
+++ lld/trunk/ELF/SymbolTable.h Fri Oct 6 18:08:28 2017
@@ -47,9 +47,6 @@ public:
DefinedRegular *addAbsolute(StringRef Name,
uint8_t Visibility = llvm::ELF::STV_HIDDEN,
uint8_t Binding = llvm::ELF::STB_GLOBAL);
- template <class ELFT>
- DefinedRegular *addIgnored(StringRef Name,
- uint8_t Visibility = llvm::ELF::STV_HIDDEN);
template <class ELFT> Symbol *addUndefined(StringRef Name);
template <class ELFT>
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=315141&r1=315140&r2=315141&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Fri Oct 6 18:08:28 2017
@@ -804,7 +804,9 @@ template <class ELFT> void Writer<ELFT>:
// __tls_get_addr, so it's not defined anywhere. Create a hidden definition
// to avoid the undefined symbol error.
if (!InX::DynSymTab)
- Symtab->addIgnored<ELFT>("__tls_get_addr");
+ if (SymbolBody *S = Symtab->find("__tls_get_addr"))
+ if (!S->isInCurrentDSO())
+ Symtab->addAbsolute<ELFT>(S->getName(), STV_HIDDEN);
// __ehdr_start is the location of ELF file headers. Note that we define
// this symbol unconditionally even when using a linker script, which
More information about the llvm-commits
mailing list