[llvm-readobj] Support non 64bit platforms too

(Orignal phab: https://reviews.llvm.org/D116787)
This commit is contained in:
Vy Nguyen 2022-03-31 15:39:17 -04:00
parent 868c212f42
commit 33e197112a
1 changed files with 3 additions and 1 deletions

View File

@ -621,7 +621,9 @@ StringRef MachODumper::getSymbolName(const SymbolRef &Symbol) const {
}
uint8_t MachODumper::getSymbolType(const SymbolRef &Symbol) const {
return Obj->getSymbol64TableEntry(Symbol.getRawDataRefImpl()).n_type;
return Obj->is64Bit()
? Obj->getSymbol64TableEntry(Symbol.getRawDataRefImpl()).n_type
: Obj->getSymbolTableEntry(Symbol.getRawDataRefImpl()).n_type;
}
bool MachODumper::compareSymbolsByName(SymbolRef LHS, SymbolRef RHS) const {