summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-03-06 20:13:41 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-03-06 20:13:41 +0000
commitabb1fadc79c3a34d3b41d949f0e20729c153d2fb (patch)
treed027bc13252996082434523b258980f3ef3e6488 /tools
parent7ed86b085eedf04fcc13e691ffa97bdbabd285f7 (diff)
Fix the printing of n_type.
Despite the name, n_type contains the type of the symbol, but also if it is extern or private extern. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203154 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-readobj/MachODumper.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/llvm-readobj/MachODumper.cpp b/tools/llvm-readobj/MachODumper.cpp
index 6077334de2c..25dbd3e15b9 100644
--- a/tools/llvm-readobj/MachODumper.cpp
+++ b/tools/llvm-readobj/MachODumper.cpp
@@ -125,12 +125,10 @@ static const EnumEntry<unsigned> MachOSymbolFlags[] = {
static const EnumEntry<unsigned> MachOSymbolTypes[] = {
{ "Undef", 0x0 },
- { "External", 0x1 },
{ "Abs", 0x2 },
{ "Indirect", 0xA },
{ "PreboundUndef", 0xC },
- { "Section", 0xE },
- { "PrivateExternal", 0x10 }
+ { "Section", 0xE }
};
namespace {
@@ -395,7 +393,12 @@ void MachODumper::printSymbol(symbol_iterator SymI) {
if (Symbol.Type & MachO::N_STAB) {
W.printHex ("Type", "SymDebugTable", Symbol.Type);
} else {
- W.printEnum("Type", Symbol.Type, makeArrayRef(MachOSymbolTypes));
+ if (Symbol.Type & MachO::N_PEXT)
+ W.startLine() << "PrivateExtern\n";
+ if (Symbol.Type & MachO::N_EXT)
+ W.startLine() << "Extern\n";
+ W.printEnum("Type", Symbol.Type & MachO::N_TYPE,
+ makeArrayRef(MachOSymbolTypes));
}
W.printHex ("Section", SectionName, Symbol.SectionIndex);
W.printEnum ("RefType", static_cast<uint16_t>(Symbol.Flags & 0xF),