summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2014-06-19 22:49:21 +0000
committerKevin Enderby <enderby@apple.com>2014-06-19 22:49:21 +0000
commitf7b992bdcd05fd6844f96e0431505d0b9c9956f9 (patch)
tree10fe195d6305d9261ad418489f6cec9446e0b724 /tools
parent7c9dcfb29e5095d560206973c40e6a33ba108c21 (diff)
downloadllvm-f7b992bdcd05fd6844f96e0431505d0b9c9956f9.tar.gz
llvm-f7b992bdcd05fd6844f96e0431505d0b9c9956f9.tar.bz2
llvm-f7b992bdcd05fd6844f96e0431505d0b9c9956f9.tar.xz
Fix the output of llvm-nm for Mach-O files to use the characters ‘d’ and ‘b’ for
data and bss symbols instead of the generic ’s’ for a symbol in a section. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211321 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-nm/llvm-nm.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/llvm-nm/llvm-nm.cpp b/tools/llvm-nm/llvm-nm.cpp
index c6b80d1dd9..5062435d89 100644
--- a/tools/llvm-nm/llvm-nm.cpp
+++ b/tools/llvm-nm/llvm-nm.cpp
@@ -577,6 +577,10 @@ static char getSymbolNMTypeChar(MachOObjectFile &Obj, basic_symbol_iterator I) {
StringRef SegmentName = Obj.getSectionFinalSegmentName(Ref);
if (SegmentName == "__TEXT" && SectionName == "__text")
return 't';
+ else if (SegmentName == "__DATA" && SectionName == "__data")
+ return 'd';
+ else if (SegmentName == "__DATA" && SectionName == "__bss")
+ return 'b';
else
return 's';
}