mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
Remove always null argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242828 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -245,8 +245,7 @@ public:
|
|||||||
ErrorOr<StringRef> getStringTableForSymtab(const Elf_Shdr &Section) const;
|
ErrorOr<StringRef> getStringTableForSymtab(const Elf_Shdr &Section) const;
|
||||||
|
|
||||||
const char *getDynamicString(uintX_t Offset) const;
|
const char *getDynamicString(uintX_t Offset) const;
|
||||||
ErrorOr<StringRef> getSymbolVersion(const Elf_Shdr *section,
|
ErrorOr<StringRef> getSymbolVersion(const Elf_Sym *Symb,
|
||||||
const Elf_Sym *Symb,
|
|
||||||
bool &IsDefault) const;
|
bool &IsDefault) const;
|
||||||
void VerifyStrTab(const Elf_Shdr *sh) const;
|
void VerifyStrTab(const Elf_Shdr *sh) const;
|
||||||
|
|
||||||
@@ -904,40 +903,8 @@ ELFFile<ELFT>::getSectionName(const Elf_Shdr *Section) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class ELFT>
|
template <class ELFT>
|
||||||
ErrorOr<StringRef> ELFFile<ELFT>::getSymbolVersion(const Elf_Shdr *section,
|
ErrorOr<StringRef> ELFFile<ELFT>::getSymbolVersion(const Elf_Sym *symb,
|
||||||
const Elf_Sym *symb,
|
|
||||||
bool &IsDefault) const {
|
bool &IsDefault) const {
|
||||||
StringRef StrTab;
|
|
||||||
if (section) {
|
|
||||||
ErrorOr<StringRef> StrTabOrErr = getStringTable(section);
|
|
||||||
if (std::error_code EC = StrTabOrErr.getError())
|
|
||||||
return EC;
|
|
||||||
StrTab = *StrTabOrErr;
|
|
||||||
}
|
|
||||||
// Handle non-dynamic symbols.
|
|
||||||
if (section != DotDynSymSec && section != nullptr) {
|
|
||||||
// Non-dynamic symbols can have versions in their names
|
|
||||||
// A name of the form 'foo@V1' indicates version 'V1', non-default.
|
|
||||||
// A name of the form 'foo@@V2' indicates version 'V2', default version.
|
|
||||||
ErrorOr<StringRef> SymName = symb->getName(StrTab);
|
|
||||||
if (!SymName)
|
|
||||||
return SymName;
|
|
||||||
StringRef Name = *SymName;
|
|
||||||
size_t atpos = Name.find('@');
|
|
||||||
if (atpos == StringRef::npos) {
|
|
||||||
IsDefault = false;
|
|
||||||
return StringRef("");
|
|
||||||
}
|
|
||||||
++atpos;
|
|
||||||
if (atpos < Name.size() && Name[atpos] == '@') {
|
|
||||||
IsDefault = true;
|
|
||||||
++atpos;
|
|
||||||
} else {
|
|
||||||
IsDefault = false;
|
|
||||||
}
|
|
||||||
return Name.substr(atpos);
|
|
||||||
}
|
|
||||||
|
|
||||||
// This is a dynamic symbol. Look in the GNU symbol version table.
|
// This is a dynamic symbol. Look in the GNU symbol version table.
|
||||||
if (!dot_gnu_version_sec) {
|
if (!dot_gnu_version_sec) {
|
||||||
// No version table.
|
// No version table.
|
||||||
|
@@ -134,8 +134,7 @@ static std::string getFullSymbolName(const ELFO &Obj,
|
|||||||
std::string FullSymbolName(SymbolName);
|
std::string FullSymbolName(SymbolName);
|
||||||
|
|
||||||
bool IsDefault;
|
bool IsDefault;
|
||||||
ErrorOr<StringRef> Version =
|
ErrorOr<StringRef> Version = Obj.getSymbolVersion(&*Symbol, IsDefault);
|
||||||
Obj.getSymbolVersion(nullptr, &*Symbol, IsDefault);
|
|
||||||
if (Version) {
|
if (Version) {
|
||||||
FullSymbolName += (IsDefault ? "@@" : "@");
|
FullSymbolName += (IsDefault ? "@@" : "@");
|
||||||
FullSymbolName += *Version;
|
FullSymbolName += *Version;
|
||||||
|
Reference in New Issue
Block a user