[llvm] r346610 - [llvm-objdump] Add symbol 'O' for object data
Kristina Brooks via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 11 09:47:14 PST 2018
Author: kristina
Date: Sun Nov 11 09:47:13 2018
New Revision: 346610
URL: http://llvm.org/viewvc/llvm-project?rev=346610&view=rev
Log:
[llvm-objdump] Add symbol 'O' for object data
Improve compatibility with GNU objdump by showing `O` next to
global symbol names, instead of a blank space.
Patch by Higuoxing (Xing).
Reviewers: MaskRay
Differential Revision: https://reviews.llvm.org/D54380
Modified:
llvm/trunk/test/tools/llvm-objdump/WebAssembly/symbol-table.test
llvm/trunk/test/tools/llvm-objdump/X86/macho-symbol-table.test
llvm/trunk/test/tools/llvm-objdump/common-symbol-elf.test
llvm/trunk/test/tools/llvm-objdump/symbol-table-elf.test
llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
Modified: llvm/trunk/test/tools/llvm-objdump/WebAssembly/symbol-table.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/WebAssembly/symbol-table.test?rev=346610&r1=346609&r2=346610&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/WebAssembly/symbol-table.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/WebAssembly/symbol-table.test Sun Nov 11 09:47:13 2018
@@ -2,8 +2,8 @@ RUN: llvm-objdump -t %p/../Inputs/trivia
CHECK: SYMBOL TABLE:
CHECK-NEXT: 00000002 g F CODE main
-CHECK-NEXT: 00000000 l DATA .L.str
+CHECK-NEXT: 00000000 l O DATA .L.str
CHECK-NEXT: 00000000 g F *UND* puts
CHECK-NEXT: 00000003 l F CODE .LSomeOtherFunction_bitcast
CHECK-NEXT: 00000000 g F *UND* SomeOtherFunction
-CHECK-NEXT: 00000010 g DATA var
+CHECK-NEXT: 00000010 g O DATA var
Modified: llvm/trunk/test/tools/llvm-objdump/X86/macho-symbol-table.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/macho-symbol-table.test?rev=346610&r1=346609&r2=346610&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/macho-symbol-table.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/X86/macho-symbol-table.test Sun Nov 11 09:47:13 2018
@@ -1,8 +1,8 @@
RUN: llvm-objdump -macho -t %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s
-CHECK: SYMBOL TABLE:
-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 __TEXT,__eh_frame _main.eh
-CHECK: 0000000000000000 *UND* _printf
+CHECK: SYMBOL TABLE:
+CHECK-NEXT: 000000000000003b l O __TEXT,__cstring L_.str
+CHECK-NEXT: 0000000000000068 l O __TEXT,__eh_frame EH_frame0
+CHECK-NEXT: 0000000000000000 g F __TEXT,__text _main
+CHECK-NEXT: 0000000000000080 g O __TEXT,__eh_frame _main.eh
+CHECK-NEXT: 0000000000000000 *UND* _printf
Modified: llvm/trunk/test/tools/llvm-objdump/common-symbol-elf.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/common-symbol-elf.test?rev=346610&r1=346609&r2=346610&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/common-symbol-elf.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/common-symbol-elf.test Sun Nov 11 09:47:13 2018
@@ -1,3 +1,3 @@
// RUN: llvm-objdump -t %p/Inputs/common-symbol-elf | FileCheck %s
-CHECK: 00000400 g *COM* 00000008 common_symbol
+CHECK: 00000400 g O *COM* 00000008 common_symbol
Modified: llvm/trunk/test/tools/llvm-objdump/symbol-table-elf.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/symbol-table-elf.test?rev=346610&r1=346609&r2=346610&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/symbol-table-elf.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/symbol-table-elf.test Sun Nov 11 09:47:13 2018
@@ -5,9 +5,9 @@
# CHECK: SYMBOL TABLE:
# CHECK-NEXT: 0000000000000000 *UND* 00000000
# CHECK-NEXT: 0000000000001004 l F .text 00000000 lfoo
-# CHECK-NEXT: 0000000000001008 l .text 00000000 lbar
+# CHECK-NEXT: 0000000000001008 l O .text 00000000 lbar
# CHECK-NEXT: 0000000000001004 g F .text 00000000 foo
-# CHECK-NEXT: 0000000000001008 g .text 00000000 bar
+# CHECK-NEXT: 0000000000001008 g O .text 00000000 bar
!ELF
FileHeader:
Modified: llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp?rev=346610&r1=346609&r2=346610&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp Sun Nov 11 09:47:13 2018
@@ -2014,6 +2014,8 @@ void llvm::PrintSymbolTable(const Object
FileFunc = 'f';
else if (Type == SymbolRef::ST_Function)
FileFunc = 'F';
+ else if (Type == SymbolRef::ST_Data)
+ FileFunc = 'O';
const char *Fmt = o->getBytesInAddress() > 4 ? "%016" PRIx64 :
"%08" PRIx64;
More information about the llvm-commits
mailing list