summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-objdump
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2014-09-24 23:08:22 +0000
committerKevin Enderby <enderby@apple.com>2014-09-24 23:08:22 +0000
commitbf246f5a9d7e3494a2e7f291365e63ba0a579718 (patch)
tree95e59cff6697206240c3d0e7697179c8c6851b34 /llvm/test/tools/llvm-objdump
parentf502d72d4e55ddff4ae2467cccb14da1136cfc83 (diff)
downloadbcm5719-llvm-bf246f5a9d7e3494a2e7f291365e63ba0a579718.tar.gz
bcm5719-llvm-bf246f5a9d7e3494a2e7f291365e63ba0a579718.zip
Flush out enough of llvm-objdump’s SymbolizerSymbolLookUp() for Mach-O files to
get the literal string “Hello world” printed as a comment on the instruction that loads the pointer to it. For now this is just for x86_64. So for object files with relocation entries it produces things like: leaq L_.str(%rip), %rax ## literal pool for: "Hello world\n" and similar for fully linked images like executables: leaq 0x4f(%rip), %rax ## literal pool for: "Hello world\n" Also to allow testing against darwin’s otool(1), I hooked up the existing -no-show-raw-insn option to the Mach-O parser code, added the new Mach-O only -full-leading-addr option to match otool(1)'s printing of addresses and also added the new -print-imm-hex option. llvm-svn: 218423
Diffstat (limited to 'llvm/test/tools/llvm-objdump')
-rw-r--r--llvm/test/tools/llvm-objdump/X86/macho-symbolized-disassembly.test9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/test/tools/llvm-objdump/X86/macho-symbolized-disassembly.test b/llvm/test/tools/llvm-objdump/X86/macho-symbolized-disassembly.test
index 23b54563078..01105fbf3fd 100644
--- a/llvm/test/tools/llvm-objdump/X86/macho-symbolized-disassembly.test
+++ b/llvm/test/tools/llvm-objdump/X86/macho-symbolized-disassembly.test
@@ -1,4 +1,7 @@
-// RUN: llvm-objdump -d -m %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s
+// RUN: llvm-objdump -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s -check-prefix=OBJ
+// RUN: llvm-objdump -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex %p/Inputs/hello.exe.macho-x86_64 | FileCheck %s -check-prefix=EXE
-CHECK: leaq L_.str(%rip), %rax
-CHECK: callq _printf
+OBJ: 0000000000000008 leaq L_.str(%rip), %rax ## literal pool for: "Hello world\n"
+OBJ: 0000000000000026 callq _printf
+
+EXE: 0000000100000f38 leaq 0x4f(%rip), %rax ## literal pool for: "Hello world\n"
OpenPOWER on IntegriCloud