[PATCH] D14576: [Object, MachO] Mark symbols from DATA and BSS sections as ST_Data
Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 12 01:43:09 PST 2015
This revision was automatically updated to reflect the committed changes.
Closed by commit rL252867: [Object, MachO] Mark symbols from DATA and BSS sections as ST_Data (authored by kuba.brecka).
Changed prior to commit:
http://reviews.llvm.org/D14576?vs=39938&id=40017#toc
Repository:
rL LLVM
http://reviews.llvm.org/D14576
Files:
llvm/trunk/lib/Object/MachOObjectFile.cpp
llvm/trunk/test/tools/llvm-objdump/X86/macho-symbol-table.test
llvm/trunk/tools/llvm-objdump/MachODump.cpp
Index: llvm/trunk/tools/llvm-objdump/MachODump.cpp
===================================================================
--- llvm/trunk/tools/llvm-objdump/MachODump.cpp
+++ llvm/trunk/tools/llvm-objdump/MachODump.cpp
@@ -6173,7 +6173,7 @@
StringRef SymName = *SymNameOrErr;
SymbolRef::Type ST = Symbols[SymIdx].getType();
- if (ST != SymbolRef::ST_Function)
+ if (ST != SymbolRef::ST_Function && ST != SymbolRef::ST_Data)
continue;
// Make sure the symbol is defined in this section.
Index: llvm/trunk/test/tools/llvm-objdump/X86/macho-symbol-table.test
===================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/macho-symbol-table.test
+++ llvm/trunk/test/tools/llvm-objdump/X86/macho-symbol-table.test
@@ -1,8 +1,8 @@
RUN: llvm-objdump -macho -t %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s
CHECK: SYMBOL TABLE:
-CHECK: 000000000000003b l F __TEXT,__cstring L_.str
-CHECK: 0000000000000068 l F __TEXT,__eh_frame EH_frame0
+CHECK: 000000000000003b l __TEXT,__cstring L_.str
+CHECK: 0000000000000068 l __TEXT,__eh_frame EH_frame0
CHECK: 0000000000000000 g F __TEXT,__text _main
-CHECK: 0000000000000080 g F __TEXT,__eh_frame _main.eh
+CHECK: 0000000000000080 g __TEXT,__eh_frame _main.eh
CHECK: 0000000000000000 *UND* _printf
Index: llvm/trunk/lib/Object/MachOObjectFile.cpp
===================================================================
--- llvm/trunk/lib/Object/MachOObjectFile.cpp
+++ llvm/trunk/lib/Object/MachOObjectFile.cpp
@@ -401,6 +401,9 @@
case MachO::N_UNDF :
return SymbolRef::ST_Unknown;
case MachO::N_SECT :
+ section_iterator Sec = *getSymbolSection(Symb);
+ if (Sec->isData() || Sec->isBSS())
+ return SymbolRef::ST_Data;
return SymbolRef::ST_Function;
}
return SymbolRef::ST_Other;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14576.40017.patch
Type: text/x-patch
Size: 1920 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151112/5aa549e9/attachment.bin>
More information about the llvm-commits
mailing list