[llvm] 33e1971 - [llvm-readobj] Support non 64bit platforms too
Vy Nguyen via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 31 12:40:22 PDT 2022
Author: Vy Nguyen
Date: 2022-03-31T15:40:12-04:00
New Revision: 33e197112a21b2415e0f4e98771414adcdb5723c
URL: https://github.com/llvm/llvm-project/commit/33e197112a21b2415e0f4e98771414adcdb5723c
DIFF: https://github.com/llvm/llvm-project/commit/33e197112a21b2415e0f4e98771414adcdb5723c.diff
LOG: [llvm-readobj] Support non 64bit platforms too
(Orignal phab: https://reviews.llvm.org/D116787)
Added:
Modified:
llvm/tools/llvm-readobj/MachODumper.cpp
Removed:
################################################################################
diff --git a/llvm/tools/llvm-readobj/MachODumper.cpp b/llvm/tools/llvm-readobj/MachODumper.cpp
index d875e3b3a381e..4931ab575bb28 100644
--- a/llvm/tools/llvm-readobj/MachODumper.cpp
+++ b/llvm/tools/llvm-readobj/MachODumper.cpp
@@ -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 {
More information about the llvm-commits
mailing list