diff options
-rw-r--r-- | lld/ELF/OutputSections.cpp | 8 | ||||
-rw-r--r-- | lld/ELF/OutputSections.h | 9 |
2 files changed, 9 insertions, 8 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 2bc1fa991b9..07e79b1adf1 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -367,6 +367,14 @@ bool lld::elf2::includeInDynamicSymtab(const SymbolBody &B) { return B.isUsedInDynamicReloc(); } +bool lld::elf2::shouldKeepInSymtab(StringRef SymName) { + if (Config->DiscardNone) + return true; + + // ELF defines dynamic locals as symbols which name starts with ".L". + return !(Config->DiscardLocals && SymName.startswith(".L")); +} + template <class ELFT> SymbolTableSection<ELFT>::SymbolTableSection( SymbolTable &Table, StringTableSection<ELFT::Is64Bits> &StrTabSec, diff --git a/lld/ELF/OutputSections.h b/lld/ELF/OutputSections.h index 7ce35b05597..ee115c33586 100644 --- a/lld/ELF/OutputSections.h +++ b/lld/ELF/OutputSections.h @@ -43,14 +43,7 @@ getLocalSymVA(const typename llvm::object::ELFFile<ELFT>::Elf_Sym *Sym, bool includeInSymtab(const SymbolBody &B); bool includeInDynamicSymtab(const SymbolBody &B); - -inline bool shouldKeepInSymtab(StringRef SymName) { - if (Config->DiscardNone) - return true; - - // ELF defines dynamic locals as symbols which name starts with ".L". - return !(Config->DiscardLocals && SymName.startswith(".L")); -} +bool shouldKeepInSymtab(StringRef SymName); // This represents a section in an output file. // Different sub classes represent different types of sections. Some contain |