summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/InputFiles.cpp7
-rw-r--r--lld/ELF/Symbols.cpp2
-rw-r--r--lld/ELF/Symbols.h7
3 files changed, 7 insertions, 9 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index fcc38f675d0..e58814de57a 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -306,13 +306,12 @@ elf::ObjectFile<ELFT>::getSection(const Elf_Sym &Sym) const {
template <class ELFT>
SymbolBody *elf::ObjectFile<ELFT>::createSymbolBody(const Elf_Sym *Sym) {
- uint32_t NameOffset = Sym->st_name;
- unsigned char Binding = Sym->getBinding();
+ unsigned char Binding = Sym->getBinding();
InputSectionBase<ELFT> *Sec = getSection(*Sym);
if (Binding == STB_LOCAL) {
if (Sym->st_shndx == SHN_UNDEF)
- return new (Alloc) UndefinedElf<ELFT>(NameOffset, *Sym);
- return new (Alloc) DefinedRegular<ELFT>(NameOffset, *Sym, Sec);
+ return new (Alloc) UndefinedElf<ELFT>(*Sym);
+ return new (Alloc) DefinedRegular<ELFT>(*Sym, Sec);
}
StringRef Name = check(Sym->getName(this->StringTable));
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index cdf99791ac5..05402caa94b 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -261,7 +261,7 @@ UndefinedElf<ELFT>::UndefinedElf(StringRef N, const Elf_Sym &Sym)
Size(Sym.st_size) {}
template <typename ELFT>
-UndefinedElf<ELFT>::UndefinedElf(uint32_t NameOffset, const Elf_Sym &Sym)
+UndefinedElf<ELFT>::UndefinedElf(const Elf_Sym &Sym)
: Undefined(SymbolBody::UndefinedElfKind, NameOffset, Sym.st_other,
Sym.getType()),
Size(Sym.st_size) {
diff --git a/lld/ELF/Symbols.h b/lld/ELF/Symbols.h
index 5327b8c0d61..72d7d81425d 100644
--- a/lld/ELF/Symbols.h
+++ b/lld/ELF/Symbols.h
@@ -225,9 +225,8 @@ public:
Value(Sym.st_value), Size(Sym.st_size),
Section(Section ? Section->Repl : NullInputSection) {}
- DefinedRegular(uint32_t NameOffset, const Elf_Sym &Sym,
- InputSectionBase<ELFT> *Section)
- : Defined(SymbolBody::DefinedRegularKind, NameOffset, Sym.st_other,
+ DefinedRegular(const Elf_Sym &Sym, InputSectionBase<ELFT> *Section)
+ : Defined(SymbolBody::DefinedRegularKind, Sym.st_name, Sym.st_other,
Sym.getType()),
Value(Sym.st_value), Size(Sym.st_size),
Section(Section ? Section->Repl : NullInputSection) {
@@ -307,7 +306,7 @@ template <class ELFT> class UndefinedElf : public Undefined {
public:
UndefinedElf(StringRef N, const Elf_Sym &Sym);
- UndefinedElf(uint32_t NameOffset, const Elf_Sym &Sym);
+ UndefinedElf(const Elf_Sym &Sym);
uintX_t Size;
OpenPOWER on IntegriCloud