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));
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) {
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) {
public:
UndefinedElf(StringRef N, const Elf_Sym &Sym);
- UndefinedElf(uint32_t NameOffset, const Elf_Sym &Sym);
+ UndefinedElf(const Elf_Sym &Sym);
uintX_t Size;