@@ -371,7 +371,6 @@ class ELFFile {
371
371
// /
372
372
// / \p SymTab is used to lookup the string table to use to get the symbol's
373
373
// / name.
374
- ErrorOr<StringRef> getSymbolName (StringRef StrTab, const Elf_Sym *Symb) const ;
375
374
ErrorOr<StringRef> getSectionName (const Elf_Shdr *Section) const ;
376
375
uint64_t getSymbolIndex (const Elf_Sym *sym) const ;
377
376
ErrorOr<ArrayRef<uint8_t > > getSectionContents (const Elf_Shdr *Sec) const ;
@@ -881,7 +880,7 @@ const char *ELFFile<ELFT>::getDynamicString(uintX_t Offset) const {
881
880
template <class ELFT >
882
881
ErrorOr<StringRef>
883
882
ELFFile<ELFT>::getStaticSymbolName(const Elf_Sym *Symb) const {
884
- return getSymbolName (DotStrtab, Symb );
883
+ return Symb-> getName (DotStrtab);
885
884
}
886
885
887
886
template <class ELFT >
@@ -898,15 +897,6 @@ ErrorOr<StringRef> ELFFile<ELFT>::getSymbolName(const Elf_Sym *Symb,
898
897
return getStaticSymbolName (Symb);
899
898
}
900
899
901
- template <class ELFT >
902
- ErrorOr<StringRef> ELFFile<ELFT>::getSymbolName(StringRef StrTab,
903
- const Elf_Sym *Sym) const {
904
- uint32_t Offset = Sym->st_name ;
905
- if (Offset >= StrTab.size ())
906
- return object_error::parse_failed;
907
- return StringRef (StrTab.data () + Offset);
908
- }
909
-
910
900
template <class ELFT >
911
901
ErrorOr<StringRef>
912
902
ELFFile<ELFT>::getSectionName(const Elf_Shdr *Section) const {
@@ -932,7 +922,7 @@ ErrorOr<StringRef> ELFFile<ELFT>::getSymbolVersion(const Elf_Shdr *section,
932
922
// Non-dynamic symbols can have versions in their names
933
923
// A name of the form 'foo@V1' indicates version 'V1', non-default.
934
924
// A name of the form 'foo@@V2' indicates version 'V2', default version.
935
- ErrorOr<StringRef> SymName = getSymbolName (StrTab, symb );
925
+ ErrorOr<StringRef> SymName = symb-> getName (StrTab);
936
926
if (!SymName)
937
927
return SymName;
938
928
StringRef Name = *SymName;
0 commit comments