From 37ed9c199ca639565f6ce88105f9e39e898d82d0 Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Mon, 1 Dec 2014 14:51:49 -0800 Subject: Update aosp/master LLVM for rebase to r222494. Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d --- .../AArch64/Inputs/ObjC.exe.macho-aarch64 | Bin 0 -> 49736 bytes .../AArch64/Inputs/ObjC.obj.macho-aarch64 | Bin 0 -> 2008 bytes .../AArch64/Inputs/hello.exe.macho-aarch64 | Bin 0 -> 49416 bytes .../AArch64/Inputs/hello.obj.macho-aarch64 | Bin 0 -> 604 bytes test/tools/llvm-objdump/AArch64/lit.local.cfg | 2 + .../AArch64/macho-symbolized-disassembly.test | 23 ++ .../llvm-objdump/ARM/Inputs/hello.exe.macho-arm | Bin 0 -> 49408 bytes .../llvm-objdump/ARM/Inputs/hello.obj.macho-arm | Bin 0 -> 744 bytes test/tools/llvm-objdump/ARM/lit.local.cfg | 2 + .../llvm-objdump/ARM/macho-arm-and-thumb.test | 15 + test/tools/llvm-objdump/ARM/macho-mattr-arm.test | 5 + test/tools/llvm-objdump/ARM/macho-mcpu-arm.test | 10 + .../ARM/macho-symbolized-disassembly.test | 8 + .../ARM/macho-symbolized-subtractor.test | 15 + .../llvm-objdump/Inputs/bad-ordinal.macho-x86_64 | Bin 0 -> 8496 bytes test/tools/llvm-objdump/Inputs/bind.macho-x86_64 | Bin 0 -> 8776 bytes test/tools/llvm-objdump/Inputs/bind2.macho-x86_64 | Bin 0 -> 8376 bytes .../llvm-objdump/Inputs/compact-unwind.macho-i386 | Bin 0 -> 2140 bytes .../Inputs/compact-unwind.macho-x86_64 | Bin 0 -> 2272 bytes .../llvm-objdump/Inputs/exports-trie.macho-x86_64 | Bin 0 -> 8752 bytes .../llvm-objdump/Inputs/large-bss.obj.coff-i386 | Bin 0 -> 270 bytes .../llvm-objdump/Inputs/lazy-bind.macho-x86_64 | Bin 0 -> 8592 bytes .../Inputs/out-of-section-sym.elf-i386 | Bin 4450 -> 0 bytes test/tools/llvm-objdump/Inputs/rebase.macho-x86_64 | Bin 0 -> 8336 bytes .../tools/llvm-objdump/Inputs/trivial.obj.elf-i386 | Bin 449 -> 0 bytes .../Inputs/unwind-info-no-relocs.macho-x86_64 | Bin 0 -> 12600 bytes .../llvm-objdump/Inputs/unwind-info.macho-arm64 | Bin 0 -> 50024 bytes .../llvm-objdump/Inputs/unwind-info.macho-x86_64 | Bin 0 -> 9136 bytes .../llvm-objdump/Inputs/weak-bind.macho-x86_64 | Bin 0 -> 8856 bytes .../llvm-objdump/X86/Inputs/ObjC.exe.macho-x86_64 | Bin 0 -> 8944 bytes .../llvm-objdump/X86/Inputs/ObjC.obj.macho-x86_64 | Bin 0 -> 1732 bytes .../X86/Inputs/dylibLoadKinds.macho-x86_64 | Bin 0 -> 4280 bytes .../llvm-objdump/X86/Inputs/hello.exe.macho-i386 | Bin 0 -> 8476 bytes .../llvm-objdump/X86/Inputs/hello.exe.macho-x86_64 | Bin 0 -> 8496 bytes .../llvm-objdump/X86/Inputs/hello.obj.macho-i386 | Bin 0 -> 472 bytes .../llvm-objdump/X86/Inputs/hello.obj.macho-x86_64 | Bin 0 -> 844 bytes .../X86/Inputs/hello_cpp.exe.macho-x86_64 | Bin 0 -> 15100 bytes .../X86/Inputs/out-of-section-sym.elf-i386 | Bin 0 -> 4450 bytes .../llvm-objdump/X86/Inputs/trivial.obj.elf-i386 | Bin 0 -> 449 bytes .../llvm-objdump/X86/disassembly-show-raw.test | 14 + test/tools/llvm-objdump/X86/lit.local.cfg | 2 + .../llvm-objdump/X86/macho-private-headers.test | 368 +++++++++++++++++++++ .../X86/macho-symbolized-disassembly.test | 38 +++ .../X86/macho-symbolized-subtractor-i386.test | 10 + .../X86/macho-symbolized-subtractor.test | 10 + .../tools/llvm-objdump/X86/out-of-section-sym.test | 13 + test/tools/llvm-objdump/coff-large-bss.test | 3 + test/tools/llvm-objdump/disassembly-show-raw.test | 14 - test/tools/llvm-objdump/lit.local.cfg | 2 - test/tools/llvm-objdump/macho-bad-ordinal.test | 6 + test/tools/llvm-objdump/macho-bind.test | 10 + test/tools/llvm-objdump/macho-bind2.test | 5 + .../llvm-objdump/macho-compact-unwind-i386.test | 27 ++ .../llvm-objdump/macho-compact-unwind-x86_64.test | 27 ++ test/tools/llvm-objdump/macho-exports-trie.test | 11 + test/tools/llvm-objdump/macho-lazy-bind.test | 7 + test/tools/llvm-objdump/macho-rebase.test | 15 + .../llvm-objdump/macho-unwind-info-arm64.test | 28 ++ .../llvm-objdump/macho-unwind-info-no-relocs.test | 8 + .../llvm-objdump/macho-unwind-info-x86_64.test | 29 ++ test/tools/llvm-objdump/macho-weak-bind.test | 10 + test/tools/llvm-objdump/out-of-section-sym.test | 13 - 62 files changed, 721 insertions(+), 29 deletions(-) create mode 100755 test/tools/llvm-objdump/AArch64/Inputs/ObjC.exe.macho-aarch64 create mode 100644 test/tools/llvm-objdump/AArch64/Inputs/ObjC.obj.macho-aarch64 create mode 100755 test/tools/llvm-objdump/AArch64/Inputs/hello.exe.macho-aarch64 create mode 100644 test/tools/llvm-objdump/AArch64/Inputs/hello.obj.macho-aarch64 create mode 100644 test/tools/llvm-objdump/AArch64/lit.local.cfg create mode 100644 test/tools/llvm-objdump/AArch64/macho-symbolized-disassembly.test create mode 100755 test/tools/llvm-objdump/ARM/Inputs/hello.exe.macho-arm create mode 100644 test/tools/llvm-objdump/ARM/Inputs/hello.obj.macho-arm create mode 100644 test/tools/llvm-objdump/ARM/lit.local.cfg create mode 100644 test/tools/llvm-objdump/ARM/macho-arm-and-thumb.test create mode 100644 test/tools/llvm-objdump/ARM/macho-mattr-arm.test create mode 100644 test/tools/llvm-objdump/ARM/macho-mcpu-arm.test create mode 100644 test/tools/llvm-objdump/ARM/macho-symbolized-disassembly.test create mode 100644 test/tools/llvm-objdump/ARM/macho-symbolized-subtractor.test create mode 100755 test/tools/llvm-objdump/Inputs/bad-ordinal.macho-x86_64 create mode 100755 test/tools/llvm-objdump/Inputs/bind.macho-x86_64 create mode 100755 test/tools/llvm-objdump/Inputs/bind2.macho-x86_64 create mode 100644 test/tools/llvm-objdump/Inputs/compact-unwind.macho-i386 create mode 100644 test/tools/llvm-objdump/Inputs/compact-unwind.macho-x86_64 create mode 100755 test/tools/llvm-objdump/Inputs/exports-trie.macho-x86_64 create mode 100644 test/tools/llvm-objdump/Inputs/large-bss.obj.coff-i386 create mode 100755 test/tools/llvm-objdump/Inputs/lazy-bind.macho-x86_64 delete mode 100644 test/tools/llvm-objdump/Inputs/out-of-section-sym.elf-i386 create mode 100755 test/tools/llvm-objdump/Inputs/rebase.macho-x86_64 delete mode 100644 test/tools/llvm-objdump/Inputs/trivial.obj.elf-i386 create mode 100755 test/tools/llvm-objdump/Inputs/unwind-info-no-relocs.macho-x86_64 create mode 100755 test/tools/llvm-objdump/Inputs/unwind-info.macho-arm64 create mode 100755 test/tools/llvm-objdump/Inputs/unwind-info.macho-x86_64 create mode 100755 test/tools/llvm-objdump/Inputs/weak-bind.macho-x86_64 create mode 100755 test/tools/llvm-objdump/X86/Inputs/ObjC.exe.macho-x86_64 create mode 100644 test/tools/llvm-objdump/X86/Inputs/ObjC.obj.macho-x86_64 create mode 100755 test/tools/llvm-objdump/X86/Inputs/dylibLoadKinds.macho-x86_64 create mode 100755 test/tools/llvm-objdump/X86/Inputs/hello.exe.macho-i386 create mode 100755 test/tools/llvm-objdump/X86/Inputs/hello.exe.macho-x86_64 create mode 100644 test/tools/llvm-objdump/X86/Inputs/hello.obj.macho-i386 create mode 100644 test/tools/llvm-objdump/X86/Inputs/hello.obj.macho-x86_64 create mode 100755 test/tools/llvm-objdump/X86/Inputs/hello_cpp.exe.macho-x86_64 create mode 100644 test/tools/llvm-objdump/X86/Inputs/out-of-section-sym.elf-i386 create mode 100644 test/tools/llvm-objdump/X86/Inputs/trivial.obj.elf-i386 create mode 100644 test/tools/llvm-objdump/X86/disassembly-show-raw.test create mode 100644 test/tools/llvm-objdump/X86/lit.local.cfg create mode 100644 test/tools/llvm-objdump/X86/macho-private-headers.test create mode 100644 test/tools/llvm-objdump/X86/macho-symbolized-disassembly.test create mode 100644 test/tools/llvm-objdump/X86/macho-symbolized-subtractor-i386.test create mode 100644 test/tools/llvm-objdump/X86/macho-symbolized-subtractor.test create mode 100644 test/tools/llvm-objdump/X86/out-of-section-sym.test create mode 100644 test/tools/llvm-objdump/coff-large-bss.test delete mode 100644 test/tools/llvm-objdump/disassembly-show-raw.test delete mode 100644 test/tools/llvm-objdump/lit.local.cfg create mode 100644 test/tools/llvm-objdump/macho-bad-ordinal.test create mode 100644 test/tools/llvm-objdump/macho-bind.test create mode 100644 test/tools/llvm-objdump/macho-bind2.test create mode 100644 test/tools/llvm-objdump/macho-compact-unwind-i386.test create mode 100644 test/tools/llvm-objdump/macho-compact-unwind-x86_64.test create mode 100644 test/tools/llvm-objdump/macho-exports-trie.test create mode 100644 test/tools/llvm-objdump/macho-lazy-bind.test create mode 100644 test/tools/llvm-objdump/macho-rebase.test create mode 100644 test/tools/llvm-objdump/macho-unwind-info-arm64.test create mode 100644 test/tools/llvm-objdump/macho-unwind-info-no-relocs.test create mode 100644 test/tools/llvm-objdump/macho-unwind-info-x86_64.test create mode 100644 test/tools/llvm-objdump/macho-weak-bind.test delete mode 100644 test/tools/llvm-objdump/out-of-section-sym.test (limited to 'test/tools/llvm-objdump') diff --git a/test/tools/llvm-objdump/AArch64/Inputs/ObjC.exe.macho-aarch64 b/test/tools/llvm-objdump/AArch64/Inputs/ObjC.exe.macho-aarch64 new file mode 100755 index 0000000..d28cbcb Binary files /dev/null and b/test/tools/llvm-objdump/AArch64/Inputs/ObjC.exe.macho-aarch64 differ diff --git a/test/tools/llvm-objdump/AArch64/Inputs/ObjC.obj.macho-aarch64 b/test/tools/llvm-objdump/AArch64/Inputs/ObjC.obj.macho-aarch64 new file mode 100644 index 0000000..8366076 Binary files /dev/null and b/test/tools/llvm-objdump/AArch64/Inputs/ObjC.obj.macho-aarch64 differ diff --git a/test/tools/llvm-objdump/AArch64/Inputs/hello.exe.macho-aarch64 b/test/tools/llvm-objdump/AArch64/Inputs/hello.exe.macho-aarch64 new file mode 100755 index 0000000..c30d358 Binary files /dev/null and b/test/tools/llvm-objdump/AArch64/Inputs/hello.exe.macho-aarch64 differ diff --git a/test/tools/llvm-objdump/AArch64/Inputs/hello.obj.macho-aarch64 b/test/tools/llvm-objdump/AArch64/Inputs/hello.obj.macho-aarch64 new file mode 100644 index 0000000..704dbab Binary files /dev/null and b/test/tools/llvm-objdump/AArch64/Inputs/hello.obj.macho-aarch64 differ diff --git a/test/tools/llvm-objdump/AArch64/lit.local.cfg b/test/tools/llvm-objdump/AArch64/lit.local.cfg new file mode 100644 index 0000000..7184443 --- /dev/null +++ b/test/tools/llvm-objdump/AArch64/lit.local.cfg @@ -0,0 +1,2 @@ +if not 'AArch64' in config.root.targets: + config.unsupported = True diff --git a/test/tools/llvm-objdump/AArch64/macho-symbolized-disassembly.test b/test/tools/llvm-objdump/AArch64/macho-symbolized-disassembly.test new file mode 100644 index 0000000..311ff51 --- /dev/null +++ b/test/tools/llvm-objdump/AArch64/macho-symbolized-disassembly.test @@ -0,0 +1,23 @@ +// RUN: llvm-objdump -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex %p/Inputs/hello.obj.macho-aarch64 | 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-aarch64 | FileCheck %s -check-prefix=EXE +// RUN: llvm-objdump -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex %p/Inputs/ObjC.obj.macho-aarch64 | FileCheck %s -check-prefix=ObjC-OBJ +// RUN: llvm-objdump -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex %p/Inputs/ObjC.exe.macho-aarch64 | FileCheck %s -check-prefix=ObjC-EXE + +OBJ: 000000000000001c adrp x0, L_.str@PAGE +OBJ: 0000000000000020 add x0, x0, L_.str@PAGEOFF +OBJ: 0000000000000024 bl _printf + +EXE: 0000000100007f58 add x0, x0, #4008 ; literal pool for: "Hello world +" +EXE: 0000000100007f5c bl 0x100007f78 ; symbol stub for: _printf + +ObjC-OBJ: 000000000000000c adrp x8, L_OBJC_SELECTOR_REFERENCES_3@PAGE +ObjC-OBJ: 0000000000000010 add x8, x8, L_OBJC_SELECTOR_REFERENCES_3@PAGEOFF +ObjC-OBJ:0000000000000044 bl _objc_msgSend + +ObjC-EXE: 0000000100007ed0 add x8, x8, #80 ; Objc selector ref: date +ObjC-EXE: 0000000100007ed8 add x9, x9, #96 ; Objc class ref: _OBJC_CLASS_$_NSDate +ObjC-EXE: 0000000100007f04 bl 0x100007f50 ; Objc message: +[NSObject new] +ObjC-EXE: 0000000100007f1c bl 0x100007f50 ; Objc message: -[x0 new] +ObjC-EXE: 0000000100007f2c add x0, x0, #32 ; Objc cfstring ref: @"The current date and time is: %@" +ObjC-EXE: 0000000100007f30 bl 0x100007f44 ; symbol stub for: _NSLog diff --git a/test/tools/llvm-objdump/ARM/Inputs/hello.exe.macho-arm b/test/tools/llvm-objdump/ARM/Inputs/hello.exe.macho-arm new file mode 100755 index 0000000..40d657b Binary files /dev/null and b/test/tools/llvm-objdump/ARM/Inputs/hello.exe.macho-arm differ diff --git a/test/tools/llvm-objdump/ARM/Inputs/hello.obj.macho-arm b/test/tools/llvm-objdump/ARM/Inputs/hello.obj.macho-arm new file mode 100644 index 0000000..fb8706b Binary files /dev/null and b/test/tools/llvm-objdump/ARM/Inputs/hello.obj.macho-arm differ diff --git a/test/tools/llvm-objdump/ARM/lit.local.cfg b/test/tools/llvm-objdump/ARM/lit.local.cfg new file mode 100644 index 0000000..236e1d3 --- /dev/null +++ b/test/tools/llvm-objdump/ARM/lit.local.cfg @@ -0,0 +1,2 @@ +if not 'ARM' in config.root.targets: + config.unsupported = True diff --git a/test/tools/llvm-objdump/ARM/macho-arm-and-thumb.test b/test/tools/llvm-objdump/ARM/macho-arm-and-thumb.test new file mode 100644 index 0000000..720b78f --- /dev/null +++ b/test/tools/llvm-objdump/ARM/macho-arm-and-thumb.test @@ -0,0 +1,15 @@ +@ RUN: llvm-mc < %s -triple armv7-apple-darwin -filetype=obj | llvm-objdump -m -d - | FileCheck %s + +.thumb +.thumb_func _t +_t: +nop +nop +.align 2 +.arm +_a: +nop + +@ CHECK: 00 bf nop +@ CHECK-NEXT: 00 bf nop +@ CHECK: 00 f0 20 e3 nop diff --git a/test/tools/llvm-objdump/ARM/macho-mattr-arm.test b/test/tools/llvm-objdump/ARM/macho-mattr-arm.test new file mode 100644 index 0000000..1b17146 --- /dev/null +++ b/test/tools/llvm-objdump/ARM/macho-mattr-arm.test @@ -0,0 +1,5 @@ +@ RUN: llvm-mc < %s -triple armv8-apple-darwin10 -mattr=+fp-armv8 -filetype=obj -o - | llvm-objdump -d -m -mattr=+fp-armv8 - | FileCheck %s + +vcvtt.f64.f16 d3, s1 + +@ CHECK: e0 3b b2 ee vcvtt.f64.f16 d3, s1 diff --git a/test/tools/llvm-objdump/ARM/macho-mcpu-arm.test b/test/tools/llvm-objdump/ARM/macho-mcpu-arm.test new file mode 100644 index 0000000..7a3432d --- /dev/null +++ b/test/tools/llvm-objdump/ARM/macho-mcpu-arm.test @@ -0,0 +1,10 @@ +@ RUN: llvm-mc < %s -triple thumbv7-apple-darwin -mcpu=cortex-a7 -filetype=obj | llvm-objdump -triple thumbv7-apple-darwin10 -m -d -mcpu=cortex-a7 - | FileCheck %s + +.thumb +.thumb_func _t +_t: +sdiv r1, r2, r3 +udiv r1, r2, r3 + +@ CHECK: 92 fb f3 f1 sdiv r1, r2, r3 +@ CHECK: b2 fb f3 f1 udiv r1, r2, r3 diff --git a/test/tools/llvm-objdump/ARM/macho-symbolized-disassembly.test b/test/tools/llvm-objdump/ARM/macho-symbolized-disassembly.test new file mode 100644 index 0000000..eeeab52 --- /dev/null +++ b/test/tools/llvm-objdump/ARM/macho-symbolized-disassembly.test @@ -0,0 +1,8 @@ +// RUN: llvm-objdump -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex %p/Inputs/hello.obj.macho-arm | 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-arm | FileCheck %s -check-prefix=EXE + +OBJ: 00000006 movw r3, :lower16:((54-14)-4) +OBJ: 0000000a movt r3, :upper16:((54-14)-4) +OBJ: 00000024 bl _printf + +EXE: 0000bfa8 blx 0xbffc @ symbol stub for: _printf diff --git a/test/tools/llvm-objdump/ARM/macho-symbolized-subtractor.test b/test/tools/llvm-objdump/ARM/macho-symbolized-subtractor.test new file mode 100644 index 0000000..65df2a9 --- /dev/null +++ b/test/tools/llvm-objdump/ARM/macho-symbolized-subtractor.test @@ -0,0 +1,15 @@ +# RUN: llvm-mc < %s -triple armv7-apple-darwin -filetype=obj | llvm-objdump -m -d - | FileCheck %s + .thumb + .thumb_func _t +_t: + movw r3, :lower16:(Str-(PCinst+4)) + movt r3, :upper16:(Str-(PCinst+4)) + .thumb_func PCinst +PCinst: + add r3, pc + + .section __TEXT,__cstring,cstring_literals +Str: + .asciz "Hello world\n" +# CHECK: movw r3, :lower16:((Str-PCinst)-4) +# CHECK: movt r3, :upper16:((Str-PCinst)-4) diff --git a/test/tools/llvm-objdump/Inputs/bad-ordinal.macho-x86_64 b/test/tools/llvm-objdump/Inputs/bad-ordinal.macho-x86_64 new file mode 100755 index 0000000..3ab6227 Binary files /dev/null and b/test/tools/llvm-objdump/Inputs/bad-ordinal.macho-x86_64 differ diff --git a/test/tools/llvm-objdump/Inputs/bind.macho-x86_64 b/test/tools/llvm-objdump/Inputs/bind.macho-x86_64 new file mode 100755 index 0000000..51a58a7 Binary files /dev/null and b/test/tools/llvm-objdump/Inputs/bind.macho-x86_64 differ diff --git a/test/tools/llvm-objdump/Inputs/bind2.macho-x86_64 b/test/tools/llvm-objdump/Inputs/bind2.macho-x86_64 new file mode 100755 index 0000000..f756fbb Binary files /dev/null and b/test/tools/llvm-objdump/Inputs/bind2.macho-x86_64 differ diff --git a/test/tools/llvm-objdump/Inputs/compact-unwind.macho-i386 b/test/tools/llvm-objdump/Inputs/compact-unwind.macho-i386 new file mode 100644 index 0000000..174d383 Binary files /dev/null and b/test/tools/llvm-objdump/Inputs/compact-unwind.macho-i386 differ diff --git a/test/tools/llvm-objdump/Inputs/compact-unwind.macho-x86_64 b/test/tools/llvm-objdump/Inputs/compact-unwind.macho-x86_64 new file mode 100644 index 0000000..fde1bb5 Binary files /dev/null and b/test/tools/llvm-objdump/Inputs/compact-unwind.macho-x86_64 differ diff --git a/test/tools/llvm-objdump/Inputs/exports-trie.macho-x86_64 b/test/tools/llvm-objdump/Inputs/exports-trie.macho-x86_64 new file mode 100755 index 0000000..5d75060 Binary files /dev/null and b/test/tools/llvm-objdump/Inputs/exports-trie.macho-x86_64 differ diff --git a/test/tools/llvm-objdump/Inputs/large-bss.obj.coff-i386 b/test/tools/llvm-objdump/Inputs/large-bss.obj.coff-i386 new file mode 100644 index 0000000..79311d3 Binary files /dev/null and b/test/tools/llvm-objdump/Inputs/large-bss.obj.coff-i386 differ diff --git a/test/tools/llvm-objdump/Inputs/lazy-bind.macho-x86_64 b/test/tools/llvm-objdump/Inputs/lazy-bind.macho-x86_64 new file mode 100755 index 0000000..02a4d12 Binary files /dev/null and b/test/tools/llvm-objdump/Inputs/lazy-bind.macho-x86_64 differ diff --git a/test/tools/llvm-objdump/Inputs/out-of-section-sym.elf-i386 b/test/tools/llvm-objdump/Inputs/out-of-section-sym.elf-i386 deleted file mode 100644 index 4c71584..0000000 Binary files a/test/tools/llvm-objdump/Inputs/out-of-section-sym.elf-i386 and /dev/null differ diff --git a/test/tools/llvm-objdump/Inputs/rebase.macho-x86_64 b/test/tools/llvm-objdump/Inputs/rebase.macho-x86_64 new file mode 100755 index 0000000..05062d8 Binary files /dev/null and b/test/tools/llvm-objdump/Inputs/rebase.macho-x86_64 differ diff --git a/test/tools/llvm-objdump/Inputs/trivial.obj.elf-i386 b/test/tools/llvm-objdump/Inputs/trivial.obj.elf-i386 deleted file mode 100644 index fdc4874..0000000 Binary files a/test/tools/llvm-objdump/Inputs/trivial.obj.elf-i386 and /dev/null differ diff --git a/test/tools/llvm-objdump/Inputs/unwind-info-no-relocs.macho-x86_64 b/test/tools/llvm-objdump/Inputs/unwind-info-no-relocs.macho-x86_64 new file mode 100755 index 0000000..a1fd687 Binary files /dev/null and b/test/tools/llvm-objdump/Inputs/unwind-info-no-relocs.macho-x86_64 differ diff --git a/test/tools/llvm-objdump/Inputs/unwind-info.macho-arm64 b/test/tools/llvm-objdump/Inputs/unwind-info.macho-arm64 new file mode 100755 index 0000000..5b9ce9c Binary files /dev/null and b/test/tools/llvm-objdump/Inputs/unwind-info.macho-arm64 differ diff --git a/test/tools/llvm-objdump/Inputs/unwind-info.macho-x86_64 b/test/tools/llvm-objdump/Inputs/unwind-info.macho-x86_64 new file mode 100755 index 0000000..9e6ad6b Binary files /dev/null and b/test/tools/llvm-objdump/Inputs/unwind-info.macho-x86_64 differ diff --git a/test/tools/llvm-objdump/Inputs/weak-bind.macho-x86_64 b/test/tools/llvm-objdump/Inputs/weak-bind.macho-x86_64 new file mode 100755 index 0000000..6534116 Binary files /dev/null and b/test/tools/llvm-objdump/Inputs/weak-bind.macho-x86_64 differ diff --git a/test/tools/llvm-objdump/X86/Inputs/ObjC.exe.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/ObjC.exe.macho-x86_64 new file mode 100755 index 0000000..4de8a1f Binary files /dev/null and b/test/tools/llvm-objdump/X86/Inputs/ObjC.exe.macho-x86_64 differ diff --git a/test/tools/llvm-objdump/X86/Inputs/ObjC.obj.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/ObjC.obj.macho-x86_64 new file mode 100644 index 0000000..66edb3c Binary files /dev/null and b/test/tools/llvm-objdump/X86/Inputs/ObjC.obj.macho-x86_64 differ diff --git a/test/tools/llvm-objdump/X86/Inputs/dylibLoadKinds.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/dylibLoadKinds.macho-x86_64 new file mode 100755 index 0000000..87d1f8c Binary files /dev/null and b/test/tools/llvm-objdump/X86/Inputs/dylibLoadKinds.macho-x86_64 differ diff --git a/test/tools/llvm-objdump/X86/Inputs/hello.exe.macho-i386 b/test/tools/llvm-objdump/X86/Inputs/hello.exe.macho-i386 new file mode 100755 index 0000000..b1f7bd8 Binary files /dev/null and b/test/tools/llvm-objdump/X86/Inputs/hello.exe.macho-i386 differ diff --git a/test/tools/llvm-objdump/X86/Inputs/hello.exe.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/hello.exe.macho-x86_64 new file mode 100755 index 0000000..d004bed Binary files /dev/null and b/test/tools/llvm-objdump/X86/Inputs/hello.exe.macho-x86_64 differ diff --git a/test/tools/llvm-objdump/X86/Inputs/hello.obj.macho-i386 b/test/tools/llvm-objdump/X86/Inputs/hello.obj.macho-i386 new file mode 100644 index 0000000..b69d4be Binary files /dev/null and b/test/tools/llvm-objdump/X86/Inputs/hello.obj.macho-i386 differ diff --git a/test/tools/llvm-objdump/X86/Inputs/hello.obj.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/hello.obj.macho-x86_64 new file mode 100644 index 0000000..2b59a1c Binary files /dev/null and b/test/tools/llvm-objdump/X86/Inputs/hello.obj.macho-x86_64 differ diff --git a/test/tools/llvm-objdump/X86/Inputs/hello_cpp.exe.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/hello_cpp.exe.macho-x86_64 new file mode 100755 index 0000000..6b54b15 Binary files /dev/null and b/test/tools/llvm-objdump/X86/Inputs/hello_cpp.exe.macho-x86_64 differ diff --git a/test/tools/llvm-objdump/X86/Inputs/out-of-section-sym.elf-i386 b/test/tools/llvm-objdump/X86/Inputs/out-of-section-sym.elf-i386 new file mode 100644 index 0000000..4c71584 Binary files /dev/null and b/test/tools/llvm-objdump/X86/Inputs/out-of-section-sym.elf-i386 differ diff --git a/test/tools/llvm-objdump/X86/Inputs/trivial.obj.elf-i386 b/test/tools/llvm-objdump/X86/Inputs/trivial.obj.elf-i386 new file mode 100644 index 0000000..fdc4874 Binary files /dev/null and b/test/tools/llvm-objdump/X86/Inputs/trivial.obj.elf-i386 differ diff --git a/test/tools/llvm-objdump/X86/disassembly-show-raw.test b/test/tools/llvm-objdump/X86/disassembly-show-raw.test new file mode 100644 index 0000000..e9956a5 --- /dev/null +++ b/test/tools/llvm-objdump/X86/disassembly-show-raw.test @@ -0,0 +1,14 @@ +// RUN: llvm-objdump -d %p/Inputs/trivial.obj.elf-i386 \ +// RUN: | FileCheck %s -check-prefix=WITHRAW +// RUN: llvm-objdump -d -no-show-raw-insn %p/Inputs/trivial.obj.elf-i386 \ +// RUN: | FileCheck %s -check-prefix=NORAW + +// Expect to find the raw incoding when run with raw output (default), but not +// when run explicitly with -no-show-raw-insn + +WITHRAW: a1 00 00 00 00 movl + +NORAW: movl +NORAW-NOT: a1 00 + + diff --git a/test/tools/llvm-objdump/X86/lit.local.cfg b/test/tools/llvm-objdump/X86/lit.local.cfg new file mode 100644 index 0000000..c8625f4 --- /dev/null +++ b/test/tools/llvm-objdump/X86/lit.local.cfg @@ -0,0 +1,2 @@ +if not 'X86' in config.root.targets: + config.unsupported = True diff --git a/test/tools/llvm-objdump/X86/macho-private-headers.test b/test/tools/llvm-objdump/X86/macho-private-headers.test new file mode 100644 index 0000000..685b4f7 --- /dev/null +++ b/test/tools/llvm-objdump/X86/macho-private-headers.test @@ -0,0 +1,368 @@ +// RUN: llvm-objdump -p %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s +// RUN: llvm-objdump -p %p/Inputs/hello.exe.macho-x86_64 \ +// RUN: | FileCheck %s -check-prefix=EXE +// RUN: llvm-objdump -p %p/Inputs/dylibLoadKinds.macho-x86_64 \ +// RUN: | FileCheck %s -check-prefix=LOAD + +CHECK: Mach header +CHECK: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags +CHECK: MH_MAGIC_64 X86_64 ALL 0x00 OBJECT 3 496 SUBSECTIONS_VIA_SYMBOLS +CHECK: Load command 0 +CHECK: cmd LC_SEGMENT_64 +CHECK: cmdsize 392 +CHECK: segname +CHECK: vmaddr 0x0000000000000000 +CHECK: vmsize 0x00000000000000a8 +CHECK: fileoff 528 +CHECK: filesize 168 +CHECK: maxprot rwx +CHECK: initprot rwx +CHECK: nsects 4 +CHECK: flags (none) +CHECK: Section +CHECK: sectname __text +CHECK: segname __TEXT +CHECK: addr 0x0000000000000000 +CHECK: size 0x000000000000003b +CHECK: offset 528 +CHECK: align 2^4 (16) +CHECK: reloff 696 +CHECK: nreloc 2 +CHECK: type S_REGULAR +CHECK: attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS +CHECK: reserved1 0 +CHECK: reserved2 0 +CHECK: Section +CHECK: sectname __cstring +CHECK: segname __TEXT +CHECK: addr 0x000000000000003b +CHECK: size 0x000000000000000d +CHECK: offset 587 +CHECK: align 2^0 (1) +CHECK: reloff 0 +CHECK: nreloc 0 +CHECK: type S_CSTRING_LITERALS +CHECK: attributes (none) +CHECK: reserved1 0 +CHECK: reserved2 0 +CHECK: Section +CHECK: sectname __compact_unwind +CHECK: segname __LD +CHECK: addr 0x0000000000000048 +CHECK: size 0x0000000000000020 +CHECK: offset 600 +CHECK: align 2^3 (8) +CHECK: reloff 712 +CHECK: nreloc 1 +CHECK: type S_REGULAR +CHECK: attributes DEBUG +CHECK: reserved1 0 +CHECK: reserved2 0 +CHECK: Section +CHECK: sectname __eh_frame +CHECK: segname __TEXT +CHECK: addr 0x0000000000000068 +CHECK: size 0x0000000000000040 +CHECK: offset 632 +CHECK: align 2^3 (8) +CHECK: reloff 0 +CHECK: nreloc 0 +CHECK: type S_COALESCED +CHECK: attributes NO_TOC STRIP_STATIC_SYMS LIVE_SUPPORT +CHECK: reserved1 0 +CHECK: reserved2 0 +CHECK: Load command 1 +CHECK: cmd LC_SYMTAB +CHECK: cmdsize 24 +CHECK: symoff 720 +CHECK: nsyms 5 +CHECK: stroff 800 +CHECK: strsize 44 +CHECK: Load command 2 +CHECK: cmd LC_DYSYMTAB +CHECK: cmdsize 80 +CHECK: ilocalsym 0 +CHECK: nlocalsym 2 +CHECK: iextdefsym 2 +CHECK: nextdefsym 2 +CHECK: iundefsym 4 +CHECK: nundefsym 1 +CHECK: tocoff 0 +CHECK: ntoc 0 +CHECK: modtaboff 0 +CHECK: nmodtab 0 +CHECK: extrefsymoff 0 +CHECK: nextrefsyms 0 +CHECK: indirectsymoff 0 +CHECK: nindirectsyms 0 +CHECK: extreloff 0 +CHECK: nextrel 0 +CHECK: locreloff 0 +CHECK: nlocrel 0 + +EXE: Mach header +EXE: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags +EXE: MH_MAGIC_64 X86_64 ALL LIB64 EXECUTE 16 1296 NOUNDEFS DYLDLINK TWOLEVEL PIE +EXE: Load command 0 +EXE: cmd LC_SEGMENT_64 +EXE: cmdsize 72 +EXE: segname __PAGEZERO +EXE: vmaddr 0x0000000000000000 +EXE: vmsize 0x0000000100000000 +EXE: fileoff 0 +EXE: filesize 0 +EXE: maxprot --- +EXE: initprot --- +EXE: nsects 0 +EXE: flags (none) +EXE: Load command 1 +EXE: cmd LC_SEGMENT_64 +EXE: cmdsize 552 +EXE: segname __TEXT +EXE: vmaddr 0x0000000100000000 +EXE: vmsize 0x0000000000001000 +EXE: fileoff 0 +EXE: filesize 4096 +EXE: maxprot rwx +EXE: initprot r-x +EXE: nsects 6 +EXE: flags (none) +EXE: Section +EXE: sectname __text +EXE: segname __TEXT +EXE: addr 0x0000000100000f30 +EXE: size 0x000000000000003b +EXE: offset 3888 +EXE: align 2^4 (16) +EXE: reloff 0 +EXE: nreloc 0 +EXE: type S_REGULAR +EXE: attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS +EXE: reserved1 0 +EXE: reserved2 0 +EXE: Section +EXE: sectname __stubs +EXE: segname __TEXT +EXE: addr 0x0000000100000f6c +EXE: size 0x0000000000000006 +EXE: offset 3948 +EXE: align 2^1 (2) +EXE: reloff 0 +EXE: nreloc 0 +EXE: type S_SYMBOL_STUBS +EXE: attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS +EXE: reserved1 0 (index into indirect symbol table) +EXE: reserved2 6 (size of stubs) +EXE: Section +EXE: sectname __stub_helper +EXE: segname __TEXT +EXE: addr 0x0000000100000f74 +EXE: size 0x000000000000001a +EXE: offset 3956 +EXE: align 2^2 (4) +EXE: reloff 0 +EXE: nreloc 0 +EXE: type S_REGULAR +EXE: attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS +EXE: reserved1 0 +EXE: reserved2 0 +EXE: Section +EXE: sectname __cstring +EXE: segname __TEXT +EXE: addr 0x0000000100000f8e +EXE: size 0x000000000000000d +EXE: offset 3982 +EXE: align 2^0 (1) +EXE: reloff 0 +EXE: nreloc 0 +EXE: type S_CSTRING_LITERALS +EXE: attributes (none) +EXE: reserved1 0 +EXE: reserved2 0 +EXE: Section +EXE: sectname __unwind_info +EXE: segname __TEXT +EXE: addr 0x0000000100000f9b +EXE: size 0x0000000000000048 +EXE: offset 3995 +EXE: align 2^0 (1) +EXE: reloff 0 +EXE: nreloc 0 +EXE: type S_REGULAR +EXE: attributes (none) +EXE: reserved1 0 +EXE: reserved2 0 +EXE: Section +EXE: sectname __eh_frame +EXE: segname __TEXT +EXE: addr 0x0000000100000fe8 +EXE: size 0x0000000000000018 +EXE: offset 4072 +EXE: align 2^3 (8) +EXE: reloff 0 +EXE: nreloc 0 +EXE: type S_REGULAR +EXE: attributes (none) +EXE: reserved1 0 +EXE: reserved2 0 +EXE: Load command 2 +EXE: cmd LC_SEGMENT_64 +EXE: cmdsize 232 +EXE: segname __DATA +EXE: vmaddr 0x0000000100001000 +EXE: vmsize 0x0000000000001000 +EXE: fileoff 4096 +EXE: filesize 4096 +EXE: maxprot rwx +EXE: initprot rw- +EXE: nsects 2 +EXE: flags (none) +EXE: Section +EXE: sectname __nl_symbol_ptr +EXE: segname __DATA +EXE: addr 0x0000000100001000 +EXE: size 0x0000000000000010 +EXE: offset 4096 +EXE: align 2^3 (8) +EXE: reloff 0 +EXE: nreloc 0 +EXE: type S_NON_LAZY_SYMBOL_POINTERS +EXE: attributes (none) +EXE: reserved1 1 (index into indirect symbol table) +EXE: reserved2 0 +EXE: Section +EXE: sectname __la_symbol_ptr +EXE: segname __DATA +EXE: addr 0x0000000100001010 +EXE: size 0x0000000000000008 +EXE: offset 4112 +EXE: align 2^3 (8) +EXE: reloff 0 +EXE: nreloc 0 +EXE: type S_LAZY_SYMBOL_POINTERS +EXE: attributes (none) +EXE: reserved1 3 (index into indirect symbol table) +EXE: reserved2 0 +EXE: Load command 3 +EXE: cmd LC_SEGMENT_64 +EXE: cmdsize 72 +EXE: segname __LINKEDIT +EXE: vmaddr 0x0000000100002000 +EXE: vmsize 0x0000000000001000 +EXE: fileoff 8192 +EXE: filesize 304 +EXE: maxprot rwx +EXE: initprot r-- +EXE: nsects 0 +EXE: flags (none) +EXE: Load command 4 +EXE: cmd LC_DYLD_INFO_ONLY +EXE: cmdsize 48 +EXE: rebase_off 8192 +EXE: rebase_size 8 +EXE: bind_off 8200 +EXE: bind_size 24 +EXE: weak_bind_off 0 +EXE: weak_bind_size 0 +EXE: lazy_bind_off 8224 +EXE: lazy_bind_size 16 +EXE: export_off 8240 +EXE: export_size 48 +EXE: Load command 5 +EXE: cmd LC_SYMTAB +EXE: cmdsize 24 +EXE: symoff 8360 +EXE: nsyms 4 +EXE: stroff 8440 +EXE: strsize 56 +EXE: Load command 6 +EXE: cmd LC_DYSYMTAB +EXE: cmdsize 80 +EXE: ilocalsym 0 +EXE: nlocalsym 0 +EXE: iextdefsym 0 +EXE: nextdefsym 2 +EXE: iundefsym 2 +EXE: nundefsym 2 +EXE: tocoff 0 +EXE: ntoc 0 +EXE: modtaboff 0 +EXE: nmodtab 0 +EXE: extrefsymoff 0 +EXE: nextrefsyms 0 +EXE: indirectsymoff 8424 +EXE: nindirectsyms 4 +EXE: extreloff 0 +EXE: nextrel 0 +EXE: locreloff 0 +EXE: nlocrel 0 +EXE: Load command 7 +EXE: cmd LC_LOAD_DYLINKER +EXE: cmdsize 32 +EXE: name /usr/lib/dyld (offset 12) +EXE: Load command 8 +EXE: cmd LC_UUID +EXE: cmdsize 24 +EXE: uuid 65C2DD41-79B0-3B34-871B-8CB3446AB762 +EXE: Load command 9 +EXE: cmd LC_VERSION_MIN_MACOSX +EXE: cmdsize 16 +EXE: version 10.9 +EXE: sdk 10.9 +EXE: Load command 10 +EXE: cmd LC_SOURCE_VERSION +EXE: cmdsize 16 +EXE: version 0.0 +EXE: Load command 11 +EXE: cmd LC_MAIN +EXE: cmdsize 24 +EXE: entryoff 3888 +EXE: stacksize 0 +EXE: Load command 12 +EXE: cmd LC_LOAD_DYLIB +EXE: cmdsize 56 +EXE: name /usr/lib/libSystem.B.dylib (offset 24) +EXE: current version 1197.1.1 +EXE: compatibility version 1.0.0 +EXE: Load command 13 +EXE: cmd LC_FUNCTION_STARTS +EXE: cmdsize 16 +EXE: dataoff 8288 +EXE: datasize 8 +EXE: Load command 14 +EXE: cmd LC_DATA_IN_CODE +EXE: cmdsize 16 +EXE: dataoff 8296 +EXE: datasize 0 +EXE: Load command 15 +EXE: cmd LC_DYLIB_CODE_SIGN_DRS +EXE: cmdsize 16 +EXE: dataoff 8296 +EXE: datasize 64 + + +LOAD: Load command 10 +LOAD: cmd LC_LOAD_DYLIB +LOAD: cmdsize 48 +LOAD: name /usr/lib/foo1.dylib (offset 24) +LOAD: current version 0.0.0 +LOAD: compatibility version 0.0.0 +LOAD: Load command 11 +LOAD: cmd LC_LOAD_WEAK_DYLIB +LOAD: cmdsize 48 +LOAD: name /usr/lib/foo2.dylib (offset 24) +LOAD: current version 0.0.0 +LOAD: compatibility version 0.0.0 +LOAD: Load command 12 +LOAD: cmd LC_REEXPORT_DYLIB +LOAD: cmdsize 48 +LOAD: name /usr/lib/foo3.dylib (offset 24) +LOAD: current version 0.0.0 +LOAD: compatibility version 0.0.0 +LOAD: Load command 13 +LOAD: cmd LC_LAZY_LOAD_DYLIB +LOAD: cmdsize 48 +LOAD: name /usr/lib/foo4.dylib (offset 24) +LOAD: current version 0.0.0 +LOAD: compatibility version 0.0.0 + diff --git a/test/tools/llvm-objdump/X86/macho-symbolized-disassembly.test b/test/tools/llvm-objdump/X86/macho-symbolized-disassembly.test new file mode 100644 index 0000000..1e1080a --- /dev/null +++ b/test/tools/llvm-objdump/X86/macho-symbolized-disassembly.test @@ -0,0 +1,38 @@ +// 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 +// RUN: llvm-objdump -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex %p/Inputs/ObjC.obj.macho-x86_64 | FileCheck %s -check-prefix=ObjC-OBJ +// RUN: llvm-objdump -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex %p/Inputs/ObjC.exe.macho-x86_64 | FileCheck %s -check-prefix=ObjC-EXE +// RUN: llvm-objdump -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex %p/Inputs/hello_cpp.exe.macho-x86_64 | FileCheck %s -check-prefix=CXX-EXE + +// RUN: llvm-objdump -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex %p/Inputs/hello.obj.macho-i386 | FileCheck %s -check-prefix=i386-OBJ +// RUN: llvm-objdump -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex %p/Inputs/hello.exe.macho-i386 | FileCheck %s -check-prefix=i386-EXE + +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" +EXE: 0000000100000f56 callq 0x100000f6c ## symbol stub for: _printf + +ObjC-OBJ: 0000000000000008 leaq 0xb1(%rip), %rax ## Objc cfstring ref: @"The current date and time is: %@" +ObjC-OBJ: 0000000000000016 movq 0x4b(%rip), %rcx ## Objc class ref: NSObject +ObjC-OBJ: 000000000000001d movq 0x64(%rip), %rsi ## Objc selector ref: new +ObjC-OBJ: 0000000000000034 movq 0x35(%rip), %rax ## Objc class ref: NSDate +ObjC-OBJ: 000000000000003b movq 0x4e(%rip), %rsi ## Objc selector ref: date + +ObjC-EXE: 0000000100000ee8 leaq 0x159(%rip), %rax ## Objc cfstring ref: @"The current date and time is: %@" +ObjC-EXE: 0000000100000ef6 movq 0x13b(%rip), %rcx ## Objc class ref: _OBJC_CLASS_$_NSObject +ObjC-EXE: 0000000100000efd movq 0x124(%rip), %rsi ## Objc selector ref: new +ObjC-EXE: 0000000100000f0b callq 0x100000f4a ## Objc message: +[NSObject new] +ObjC-EXE: 0000000100000f14 movq 0x125(%rip), %rax ## Objc class ref: _OBJC_CLASS_$_NSDate +ObjC-EXE: 0000000100000f1b movq 0x10e(%rip), %rsi ## Objc selector ref: date +ObjC-EXE: 0000000100000f25 callq 0x100000f4a ## Objc message: +[NSDate date] +ObjC-EXE: 0000000100000f33 callq 0x100000f44 ## symbol stub for: _NSLog + +CXX-EXE: 00000001000014cb callq __ZNSt3__116__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_ + +// FIXME: Demangler depends on host's . +// std::__1::ostreambuf_iterator > std::__1::__pad_and_output >(std::__1::ostreambuf_iterator >, char const*, char const*, char const*, std::__1::ios_base&, char) + +i386-OBJ: 0000002f calll _printf + +i386-EXE: 00001f6f calll 0x1f84 ## symbol stub for: _printf diff --git a/test/tools/llvm-objdump/X86/macho-symbolized-subtractor-i386.test b/test/tools/llvm-objdump/X86/macho-symbolized-subtractor-i386.test new file mode 100644 index 0000000..a0f753b --- /dev/null +++ b/test/tools/llvm-objdump/X86/macho-symbolized-subtractor-i386.test @@ -0,0 +1,10 @@ +# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -d - | FileCheck %s + +nop +x: +leal x-y(%eax), %ebx +.data +y: +.quad 0 + +# CHECK: leal x-y(%eax), %ebx diff --git a/test/tools/llvm-objdump/X86/macho-symbolized-subtractor.test b/test/tools/llvm-objdump/X86/macho-symbolized-subtractor.test new file mode 100644 index 0000000..a730b5c --- /dev/null +++ b/test/tools/llvm-objdump/X86/macho-symbolized-subtractor.test @@ -0,0 +1,10 @@ +# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -d - | FileCheck %s + +nop +x: +leaq x-y(%rax), %rbx +.data +y: +.quad 0 + +# CHECK: leaq x-y(%rax), %rbx diff --git a/test/tools/llvm-objdump/X86/out-of-section-sym.test b/test/tools/llvm-objdump/X86/out-of-section-sym.test new file mode 100644 index 0000000..f70dce6 --- /dev/null +++ b/test/tools/llvm-objdump/X86/out-of-section-sym.test @@ -0,0 +1,13 @@ +// Check that llvm-objdump does not attempt to disassemble symbols outside +// of section boundaries. +// RUN: llvm-objdump -d -t %p/Inputs/out-of-section-sym.elf-i386 | FileCheck %s + +CHECK: Disassembly of section .text: +CHECK-NEXT: _start: +CHECK-NEXT: 10: c3 retl +CHECK-NEXT: SYMBOL TABLE: +CHECK-NEXT: 00000000 *UND* 00000000 +CHECK-NEXT: 00000010 l d .text 00000000 .text +CHECK-NEXT: 00000010 .text 00000000 _start +CHECK-NEXT: 00000020 .text 00000000 _fdata +CHECK-NEXT: 00000010 .text 00000000 _ftext diff --git a/test/tools/llvm-objdump/coff-large-bss.test b/test/tools/llvm-objdump/coff-large-bss.test new file mode 100644 index 0000000..dc0fc67 --- /dev/null +++ b/test/tools/llvm-objdump/coff-large-bss.test @@ -0,0 +1,3 @@ +RUN: llvm-objdump -s %p/Inputs/large-bss.obj.coff-i386 | FileCheck %s + +: CHECK: diff --git a/test/tools/llvm-objdump/disassembly-show-raw.test b/test/tools/llvm-objdump/disassembly-show-raw.test deleted file mode 100644 index e9956a5..0000000 --- a/test/tools/llvm-objdump/disassembly-show-raw.test +++ /dev/null @@ -1,14 +0,0 @@ -// RUN: llvm-objdump -d %p/Inputs/trivial.obj.elf-i386 \ -// RUN: | FileCheck %s -check-prefix=WITHRAW -// RUN: llvm-objdump -d -no-show-raw-insn %p/Inputs/trivial.obj.elf-i386 \ -// RUN: | FileCheck %s -check-prefix=NORAW - -// Expect to find the raw incoding when run with raw output (default), but not -// when run explicitly with -no-show-raw-insn - -WITHRAW: a1 00 00 00 00 movl - -NORAW: movl -NORAW-NOT: a1 00 - - diff --git a/test/tools/llvm-objdump/lit.local.cfg b/test/tools/llvm-objdump/lit.local.cfg deleted file mode 100644 index c8625f4..0000000 --- a/test/tools/llvm-objdump/lit.local.cfg +++ /dev/null @@ -1,2 +0,0 @@ -if not 'X86' in config.root.targets: - config.unsupported = True diff --git a/test/tools/llvm-objdump/macho-bad-ordinal.test b/test/tools/llvm-objdump/macho-bad-ordinal.test new file mode 100644 index 0000000..16badcc --- /dev/null +++ b/test/tools/llvm-objdump/macho-bad-ordinal.test @@ -0,0 +1,6 @@ +# RUN: llvm-objdump -macho -bind -lazy-bind %p/Inputs/bad-ordinal.macho-x86_64 \ +# RUN: | FileCheck %s + + +# CHECK: __DATA __nl_symbol_ptr 0x100001000 pointer 0 <> dyld_stub_binder +# CHECK: __DATA __la_symbol_ptr 0x100001010 <> _printf diff --git a/test/tools/llvm-objdump/macho-bind.test b/test/tools/llvm-objdump/macho-bind.test new file mode 100644 index 0000000..5527bfa --- /dev/null +++ b/test/tools/llvm-objdump/macho-bind.test @@ -0,0 +1,10 @@ +# RUN: llvm-objdump -macho -bind %p/Inputs/bind.macho-x86_64 \ +# RUN: | FileCheck %s + + +# CHECK:__DATA __data 0x00001028 pointer 0 flat-namespace _any +# CHECK:__DATA __data 0x00001020 pointer 0 main-executable _fromApp +# CHECK:__DATA __data 0x00001018 pointer 0 this-image _myfunc +# CHECK:__DATA __data 0x00001000 pointer 0 libfoo _foo +# CHECK:__DATA __data 0x00001008 pointer 0 libbar _bar +# CHECK:__DATA __data 0x00001010 pointer 0 libSystem _malloc diff --git a/test/tools/llvm-objdump/macho-bind2.test b/test/tools/llvm-objdump/macho-bind2.test new file mode 100644 index 0000000..2eee2fc --- /dev/null +++ b/test/tools/llvm-objdump/macho-bind2.test @@ -0,0 +1,5 @@ +# RUN: llvm-objdump -macho -bind %p/Inputs/bind2.macho-x86_64 | FileCheck %s + +# CHECK: __DATA __data 0x00001008 pointer 0 libSystem _malloc +# CHECK: __DATA __data 0x00001050 pointer 0 libSystem _malloc +# CHECK: __DATA __data 0x00001458 pointer 0 libSystem _malloc diff --git a/test/tools/llvm-objdump/macho-compact-unwind-i386.test b/test/tools/llvm-objdump/macho-compact-unwind-i386.test new file mode 100644 index 0000000..9a14c20 --- /dev/null +++ b/test/tools/llvm-objdump/macho-compact-unwind-i386.test @@ -0,0 +1,27 @@ +# RUN: llvm-objdump -unwind-info %p/Inputs/compact-unwind.macho-i386 | FileCheck %s + +# CHECK: Contents of __compact_unwind section: +# CHECK: Entry at offset 0x0: +# CHECK: start: 0x0 __Z10test_throwv +# CHECK: length: 0x55 +# CHECK: compact encoding: 0x01010005 +# CHECK-NOT: personality function +# CHECK-NOT: LSDA +# CHECK: Entry at offset 0x14: +# CHECK: start: 0x60 __Z11test_catch1v +# CHECK: length: 0x6f +# CHECK: compact encoding: 0x41000000 +# CHECK: personality function: 0x288 __pointers + 0x8 +# CHECK: LSDA: 0x180 GCC_except_table1 +# CHECK: Entry at offset 0x28: +# CHECK: start: 0xd0 __Z11test_catch2v +# CHECK: length: 0x75 +# CHECK: compact encoding: 0x41000000 +# CHECK: personality function: 0x288 __pointers + 0x8 +# CHECK: LSDA: 0x1a8 GCC_except_table2 +# CHECK: Entry at offset 0x3c: +# CHECK: start: 0x150 __Z3foov +# CHECK: length: 0x22 +# CHECK: compact encoding: 0x01000000 +# CHECK-NOT: personality function +# CHECK-NOT: LSDA diff --git a/test/tools/llvm-objdump/macho-compact-unwind-x86_64.test b/test/tools/llvm-objdump/macho-compact-unwind-x86_64.test new file mode 100644 index 0000000..852800d --- /dev/null +++ b/test/tools/llvm-objdump/macho-compact-unwind-x86_64.test @@ -0,0 +1,27 @@ +# RUN: llvm-objdump -unwind-info %p/Inputs/compact-unwind.macho-x86_64 | FileCheck %s + +# CHECK: Contents of __compact_unwind section: +# CHECK: Entry at offset 0x0: +# CHECK: start: 0x1 __Z10test_throwv + 0x1 +# CHECK: length: 0x44 +# CHECK: compact encoding: 0x01000000 +# CHECK-NOT: personality function +# CHECK-NOT: LSDA +# CHECK: Entry at offset 0x20: +# CHECK: start: 0x50 __Z11test_catch1v +# CHECK: length: 0x71 +# CHECK: compact encoding: 0x41000000 +# CHECK: personality function: 0x0 ___gxx_personality_v0 +# CHECK: LSDA: 0x180 GCC_except_table1 +# CHECK: Entry at offset 0x40: +# CHECK: start: 0xd0 __Z11test_catch2v +# CHECK: length: 0x77 +# CHECK: compact encoding: 0x41000000 +# CHECK: personality function: 0x0 ___gxx_personality_v0 +# CHECK: LSDA: 0x1a8 GCC_except_table2 +# CHECK: Entry at offset 0x60: +# CHECK: start: 0x150 __Z3foov +# CHECK: length: 0x25 +# CHECK: compact encoding: 0x01000000 +# CHECK-NOT: personality function +# CHECK-NOT: LSDA diff --git a/test/tools/llvm-objdump/macho-exports-trie.test b/test/tools/llvm-objdump/macho-exports-trie.test new file mode 100644 index 0000000..473c7cb --- /dev/null +++ b/test/tools/llvm-objdump/macho-exports-trie.test @@ -0,0 +1,11 @@ +# RUN: llvm-objdump -macho -exports-trie -arch x86_64 \ +# RUN: %p/Inputs/exports-trie.macho-x86_64 2>/dev/null | FileCheck %s + + +# CHECK:[re-export] _malloc (from libSystem) +# CHECK:[re-export] _myfree (_free from libSystem) +# CHECK:0x00000F70 _myWeak [weak_def] +# CHECK:0x00001018 _myTLV [per-thread] +# CHECK:0x12345678 _myAbs [absolute] +# CHECK:0x00000F60 _foo + diff --git a/test/tools/llvm-objdump/macho-lazy-bind.test b/test/tools/llvm-objdump/macho-lazy-bind.test new file mode 100644 index 0000000..088ea06 --- /dev/null +++ b/test/tools/llvm-objdump/macho-lazy-bind.test @@ -0,0 +1,7 @@ +# RUN: llvm-objdump -macho -lazy-bind %p/Inputs/lazy-bind.macho-x86_64 \ +# RUN: | FileCheck %s + + +# CHECK: __DATA __la_symbol_ptr 0x100001010 libfoo _foo +# CHECK: __DATA __la_symbol_ptr 0x100001018 libbar _bar +# CHECK: __DATA __la_symbol_ptr 0x100001020 libSystem _malloc diff --git a/test/tools/llvm-objdump/macho-rebase.test b/test/tools/llvm-objdump/macho-rebase.test new file mode 100644 index 0000000..96df390 --- /dev/null +++ b/test/tools/llvm-objdump/macho-rebase.test @@ -0,0 +1,15 @@ +# RUN: llvm-objdump -macho -rebase -arch x86_64 \ +# RUN: %p/Inputs/rebase.macho-x86_64 | FileCheck %s + + +# CHECK: segment section address type +# CHECK: __DATA __data 0x00001010 pointer +# CHECK: __DATA __data 0x00001028 pointer +# CHECK: __DATA __data 0x00001030 pointer +# CHECK: __DATA __data 0x00001038 pointer +# CHECK: __DATA __data 0x00001040 pointer +# CHECK: __DATA __data 0x00001258 pointer +# CHECK: __DATA __mystuff 0x00001278 pointer +# CHECK: __DATA __mystuff 0x00001288 pointer +# CHECK: __DATA __mystuff 0x00001298 pointer +# CHECK: __DATA __mystuff 0x000012A8 pointer diff --git a/test/tools/llvm-objdump/macho-unwind-info-arm64.test b/test/tools/llvm-objdump/macho-unwind-info-arm64.test new file mode 100644 index 0000000..712edef --- /dev/null +++ b/test/tools/llvm-objdump/macho-unwind-info-arm64.test @@ -0,0 +1,28 @@ +# RUN: llvm-objdump -unwind-info %p/Inputs/unwind-info.macho-arm64 2>/dev/null | FileCheck %s + +# The 2nd level index here is "regular", including all offsets & encodings in +# full. + +# CHECK: Contents of __unwind_info section: +# CHECK: Version: 0x1 +# CHECK: Common encodings array section offset: 0x1c +# CHECK: Number of common encodings in array: 0x2 +# CHECK: Personality function array section offset: 0x24 +# CHECK: Number of personality functions in array: 0x1 +# CHECK: Index array section offset: 0x28 +# CHECK: Number of indices in array: 0x2 +# CHECK: Common encodings: (count = 2) +# CHECK: encoding[0]: 0x04000000 +# CHECK: encoding[1]: 0x54000000 +# CHECK: Personality functions: (count = 1) +# CHECK: personality[1]: 0x00008008 +# CHECK: Top level indices: (count = 2) +# CHECK: [0]: function offset=0x00007d64, 2nd level page offset=0x00000050, LSDA offset=0x00000040 +# CHECK: [1]: function offset=0x00007eb5, 2nd level page offset=0x00000000, LSDA offset=0x00000050 +# CHECK: LSDA descriptors: +# CHECK: [0]: function offset=0x00007d90, LSDA offset=0x00007f44 +# CHECK: [1]: function offset=0x00007e10, LSDA offset=0x00007f6c +# CHECK: Second level indices: +# CHECK: Second level index[0]: offset in section=0x00000050, base function offset=0x00007d64 +# CHECK: [0]: function offset=0x00007d90, encoding=0x78563412 +# CHECK: [1]: function offset=0x00007e10, encoding=0x21436587 diff --git a/test/tools/llvm-objdump/macho-unwind-info-no-relocs.test b/test/tools/llvm-objdump/macho-unwind-info-no-relocs.test new file mode 100644 index 0000000..3adad65 --- /dev/null +++ b/test/tools/llvm-objdump/macho-unwind-info-no-relocs.test @@ -0,0 +1,8 @@ +# RUN: llvm-objdump -unwind-info %p/Inputs/unwind-info-no-relocs.macho-x86_64 2>/dev/null | FileCheck %s + +# Make sure we can deal with __compact_unwind sections that don't have helpful +# relocations. + +# CHECK: Contents of __compact_unwind section: +# CHECK: Entry at offset 0x0: +# CHECK: start: 0x100000f7e diff --git a/test/tools/llvm-objdump/macho-unwind-info-x86_64.test b/test/tools/llvm-objdump/macho-unwind-info-x86_64.test new file mode 100644 index 0000000..1333d9a --- /dev/null +++ b/test/tools/llvm-objdump/macho-unwind-info-x86_64.test @@ -0,0 +1,29 @@ +# RUN: llvm-objdump -unwind-info %p/Inputs/unwind-info.macho-x86_64 2>/dev/null | FileCheck %s + +# The 2nd level index in this file is in compressed form, referring to both +# common and packed encodings. + +# CHECK:Contents of __unwind_info section: +# CHECK: Version: 0x1 +# CHECK: Common encodings array section offset: 0x1c +# CHECK: Number of common encodings in array: 0x2 +# CHECK: Personality function array section offset: 0x24 +# CHECK: Number of personality functions in array: 0x1 +# CHECK: Index array section offset: 0x28 +# CHECK: Number of indices in array: 0x2 +# CHECK: Common encodings: (count = 2) +# CHECK: encoding[0]: 0x01000000 +# CHECK: encoding[1]: 0x51000000 +# CHECK: Personality functions: (count = 1) +# CHECK: personality[1]: 0x00001018 +# CHECK: Top level indices: (count = 2) +# CHECK: [0]: function offset=0x00000d70, 2nd level page offset=0x00000050, LSDA offset=0x00000040 +# CHECK: [1]: function offset=0x00000eab, 2nd level page offset=0x00000000, LSDA offset=0x00000050 +# CHECK: LSDA descriptors: +# CHECK: [0]: function offset=0x00000db0, LSDA offset=0x00000f0c +# CHECK: [1]: function offset=0x00000e20, LSDA offset=0x00000f34 +# CHECK: Second level indices: +# CHECK: Second level index[0]: offset in section=0x00000050, base function offset=0x00000d70 +# CHECK: [0]: function offset=0x00000d70, encoding[0]=0x01000000 +# CHECK: [1]: function offset=0x00000db0, encoding[1]=0x51000000 +# CHECK: [2]: function offset=0x00000e20, encoding[2]=0x01234567 diff --git a/test/tools/llvm-objdump/macho-weak-bind.test b/test/tools/llvm-objdump/macho-weak-bind.test new file mode 100644 index 0000000..1013132 --- /dev/null +++ b/test/tools/llvm-objdump/macho-weak-bind.test @@ -0,0 +1,10 @@ +# RUN: llvm-objdump -macho -weak-bind %p/Inputs/weak-bind.macho-x86_64 \ +# RUN: | FileCheck %s + + +# CHECK: __DATA __data 0x100001018 pointer 0 __ZTISt12out_of_range +# CHECK: __DATA __data 0x100001020 pointer 0 __ZTISt12out_of_range +# CHECK: __DATA __data 0x100001028 pointer 0 __ZTISt12out_of_range +# CHECK: strong __ZdlPv +# CHECK: __DATA __data 0x100001018 pointer 0 __Znam +# CHECK: strong __Znwm diff --git a/test/tools/llvm-objdump/out-of-section-sym.test b/test/tools/llvm-objdump/out-of-section-sym.test deleted file mode 100644 index f70dce6..0000000 --- a/test/tools/llvm-objdump/out-of-section-sym.test +++ /dev/null @@ -1,13 +0,0 @@ -// Check that llvm-objdump does not attempt to disassemble symbols outside -// of section boundaries. -// RUN: llvm-objdump -d -t %p/Inputs/out-of-section-sym.elf-i386 | FileCheck %s - -CHECK: Disassembly of section .text: -CHECK-NEXT: _start: -CHECK-NEXT: 10: c3 retl -CHECK-NEXT: SYMBOL TABLE: -CHECK-NEXT: 00000000 *UND* 00000000 -CHECK-NEXT: 00000010 l d .text 00000000 .text -CHECK-NEXT: 00000010 .text 00000000 _start -CHECK-NEXT: 00000020 .text 00000000 _fdata -CHECK-NEXT: 00000010 .text 00000000 _ftext -- cgit v1.1