[lld] r285966 - Simplify now that this is only used for global symbols.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 3 13:48:58 PDT 2016
Author: rafael
Date: Thu Nov 3 15:48:57 2016
New Revision: 285966
URL: http://llvm.org/viewvc/llvm-project?rev=285966&view=rev
Log:
Simplify now that this is only used for global symbols.
Modified:
lld/trunk/ELF/InputFiles.cpp
lld/trunk/ELF/InputFiles.h
lld/trunk/ELF/Relocations.cpp
Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=285966&r1=285965&r2=285966&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Thu Nov 3 15:48:57 2016
@@ -117,10 +117,8 @@ ELFFileBase<ELFT>::ELFFileBase(Kind K, M
}
template <class ELFT>
-typename ELFT::SymRange ELFFileBase<ELFT>::getElfSymbols(bool OnlyGlobals) {
- if (OnlyGlobals)
+typename ELFT::SymRange ELFFileBase<ELFT>::getGlobalSymbols() {
return makeArrayRef(Symbols.begin() + FirstNonLocal, Symbols.end());
- return Symbols;
}
template <class ELFT>
@@ -647,7 +645,7 @@ template <class ELFT> void SharedFile<EL
const Elf_Versym *Versym = nullptr;
std::vector<const Elf_Verdef *> Verdefs = parseVerdefs(Versym);
- Elf_Sym_Range Syms = this->getElfSymbols(true);
+ Elf_Sym_Range Syms = this->getGlobalSymbols();
for (const Elf_Sym &Sym : Syms) {
unsigned VersymIndex = 0;
if (Versym) {
Modified: lld/trunk/ELF/InputFiles.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.h?rev=285966&r1=285965&r2=285966&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.h (original)
+++ lld/trunk/ELF/InputFiles.h Thu Nov 3 15:48:57 2016
@@ -108,7 +108,7 @@ public:
uint32_t getSectionIndex(const Elf_Sym &Sym) const;
- Elf_Sym_Range getElfSymbols(bool OnlyGlobals);
+ Elf_Sym_Range getGlobalSymbols();
protected:
ArrayRef<Elf_Sym> Symbols;
Modified: lld/trunk/ELF/Relocations.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.cpp?rev=285966&r1=285965&r2=285966&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.cpp (original)
+++ lld/trunk/ELF/Relocations.cpp Thu Nov 3 15:48:57 2016
@@ -402,7 +402,7 @@ template <class ELFT> static void addCop
// Look through the DSO's dynamic symbol table for aliases and create a
// dynamic symbol for each one. This causes the copy relocation to correctly
// interpose any aliases.
- for (const Elf_Sym &S : SS->file()->getElfSymbols(true)) {
+ for (const Elf_Sym &S : SS->file()->getGlobalSymbols()) {
if (S.st_shndx != Shndx || S.st_value != Value)
continue;
auto *Alias = dyn_cast_or_null<SharedSymbol<ELFT>>(
More information about the llvm-commits
mailing list