diff options
Diffstat (limited to 'test/tools/llvm-objdump')
35 files changed, 1005 insertions, 0 deletions
diff --git a/test/tools/llvm-objdump/AArch64/Inputs/link-opt-hints.macho-aarch64 b/test/tools/llvm-objdump/AArch64/Inputs/link-opt-hints.macho-aarch64 Binary files differnew file mode 100644 index 0000000..12d33fc --- /dev/null +++ b/test/tools/llvm-objdump/AArch64/Inputs/link-opt-hints.macho-aarch64 diff --git a/test/tools/llvm-objdump/AArch64/macho-link-opt-hints.test b/test/tools/llvm-objdump/AArch64/macho-link-opt-hints.test new file mode 100644 index 0000000..932bc4f --- /dev/null +++ b/test/tools/llvm-objdump/AArch64/macho-link-opt-hints.test @@ -0,0 +1,11 @@ +RUN: llvm-objdump -m -link-opt-hints %p/Inputs/link-opt-hints.macho-aarch64 | FileCheck %s + +CHECK: Linker optimiztion hints (8 total bytes) +CHECK: identifier 8 AdrpLdrGot +CHECK: narguments 2 +CHECK: value 0x18 +CHECK: value 0x1c +CHECK: identifier 7 AdrpAdd +CHECK: narguments 2 +CHECK: value 0x6c +CHECK: value 0x70 diff --git a/test/tools/llvm-objdump/AArch64/macho-private-headers.test b/test/tools/llvm-objdump/AArch64/macho-private-headers.test new file mode 100644 index 0000000..cdf98b1 --- /dev/null +++ b/test/tools/llvm-objdump/AArch64/macho-private-headers.test @@ -0,0 +1,312 @@ +// RUN: llvm-objdump -p %p/Inputs/hello.obj.macho-aarch64 | FileCheck %s +// RUN: llvm-objdump -p %p/Inputs/hello.exe.macho-aarch64 \ +// RUN: | FileCheck %s -check-prefix=EXE + +CHECK: Mach header +CHECK: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags +CHECK: MH_MAGIC_64 ARM64 ALL 0x00 OBJECT 4 352 SUBSECTIONS_VIA_SYMBOLS +CHECK: Load command 0 +CHECK: cmd LC_SEGMENT_64 +CHECK: cmdsize 232 +CHECK: segname +CHECK: vmaddr 0x0000000000000000 +CHECK: vmsize 0x000000000000004d +CHECK: fileoff 384 +CHECK: filesize 77 +CHECK: maxprot rwx +CHECK: initprot rwx +CHECK: nsects 2 +CHECK: flags (none) +CHECK: Section +CHECK: sectname __text +CHECK: segname __TEXT +CHECK: addr 0x0000000000000000 +CHECK: size 0x0000000000000040 +CHECK: offset 384 +CHECK: align 2^2 (4) +CHECK: reloff 464 +CHECK: nreloc 3 +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 0x0000000000000040 +CHECK: size 0x000000000000000d +CHECK: offset 448 +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: Load command 1 +CHECK: cmd LC_VERSION_MIN_IPHONEOS +CHECK: cmdsize 16 +CHECK: version 9.0 +CHECK: sdk n/a +CHECK: Load command 2 +CHECK: cmd LC_SYMTAB +CHECK: cmdsize 24 +CHECK: symoff 488 +CHECK: nsyms 5 +CHECK: stroff 568 +CHECK: strsize 36 +CHECK: Load command 3 +CHECK: cmd LC_DYSYMTAB +CHECK: cmdsize 80 +CHECK: ilocalsym 0 +CHECK: nlocalsym 3 +CHECK: iextdefsym 3 +CHECK: nextdefsym 1 +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 ARM64 ALL 0x00 EXECUTE 17 1240 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 472 +EXE: segname __TEXT +EXE: vmaddr 0x0000000100000000 +EXE: vmsize 0x0000000000008000 +EXE: fileoff 0 +EXE: filesize 32768 +EXE: maxprot r-x +EXE: initprot r-x +EXE: nsects 5 +EXE: flags (none) +EXE: Section +EXE: sectname __text +EXE: segname __TEXT +EXE: addr 0x0000000100007f38 +EXE: size 0x0000000000000040 +EXE: offset 32568 +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 __stubs +EXE: segname __TEXT +EXE: addr 0x0000000100007f78 +EXE: size 0x000000000000000c +EXE: offset 32632 +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 12 (size of stubs) +EXE: Section +EXE: sectname __stub_helper +EXE: segname __TEXT +EXE: addr 0x0000000100007f84 +EXE: size 0x0000000000000024 +EXE: offset 32644 +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 0x0000000100007fa8 +EXE: size 0x000000000000000d +EXE: offset 32680 +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 0x0000000100007fb8 +EXE: size 0x0000000000000048 +EXE: offset 32696 +EXE: align 2^2 (4) +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 0x0000000100008000 +EXE: vmsize 0x0000000000004000 +EXE: fileoff 32768 +EXE: filesize 16384 +EXE: maxprot rw- +EXE: initprot rw- +EXE: nsects 2 +EXE: flags (none) +EXE: Section +EXE: sectname __got +EXE: segname __DATA +EXE: addr 0x0000000100008000 +EXE: size 0x0000000000000010 +EXE: offset 32768 +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 0x0000000100008010 +EXE: size 0x0000000000000008 +EXE: offset 32784 +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 0x000000010000c000 +EXE: vmsize 0x0000000000004000 +EXE: fileoff 49152 +EXE: filesize 264 +EXE: maxprot r-- +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 49152 +EXE: rebase_size 8 +EXE: bind_off 49160 +EXE: bind_size 24 +EXE: weak_bind_off 0 +EXE: weak_bind_size 0 +EXE: lazy_bind_off 49184 +EXE: lazy_bind_size 16 +EXE: export_off 49200 +EXE: export_size 48 +EXE: Load command 5 +EXE: cmd LC_SYMTAB +EXE: cmdsize 24 +EXE: symoff 49280 +EXE: nsyms 4 +EXE: stroff 49360 +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 49344 +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 D687F888-CD3F-3276-8C94-BA3CCA21D820 +EXE: Load command 9 +EXE: cmd LC_VERSION_MIN_IPHONEOS +EXE: cmdsize 16 +EXE: version 9.0 +EXE: sdk 9.0 +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 32568 +EXE: stacksize 0 +EXE: Load command 12 +EXE: cmd LC_ENCRYPTION_INFO_64 +EXE: cmdsize 24 +EXE: cryptoff 16384 +EXE: cryptsize 16384 +EXE: cryptid 0 +EXE: pad 0 +EXE: Load command 13 +EXE: cmd LC_LOAD_DYLIB +EXE: cmdsize 56 +EXE: name /usr/lib/libSystem.B.dylib (offset 24) +EXE: current version 1215.0.0 +EXE: compatibility version 1.0.0 +EXE: Load command 14 +EXE: cmd LC_FUNCTION_STARTS +EXE: cmdsize 16 +EXE: dataoff 49248 +EXE: datasize 8 +EXE: Load command 15 +EXE: cmd LC_DATA_IN_CODE +EXE: cmdsize 16 +EXE: dataoff 49256 +EXE: datasize 0 +EXE: Load command 16 +EXE: cmd LC_DYLIB_CODE_SIGN_DRS +EXE: cmdsize 16 +EXE: dataoff 49256 +EXE: datasize 24 diff --git a/test/tools/llvm-objdump/ARM/Inputs/data-in-code.macho-arm b/test/tools/llvm-objdump/ARM/Inputs/data-in-code.macho-arm Binary files differnew file mode 100644 index 0000000..e826f29 --- /dev/null +++ b/test/tools/llvm-objdump/ARM/Inputs/data-in-code.macho-arm diff --git a/test/tools/llvm-objdump/ARM/macho-data-in-code.test b/test/tools/llvm-objdump/ARM/macho-data-in-code.test new file mode 100644 index 0000000..1814dc0 --- /dev/null +++ b/test/tools/llvm-objdump/ARM/macho-data-in-code.test @@ -0,0 +1,8 @@ +RUN: llvm-objdump -m -data-in-code %p/Inputs/data-in-code.macho-arm | FileCheck %s + +CHECK: Data in code table (4 entries) +CHECK: offset length kind +CHECK: 0x00000000 4 DATA +CHECK: 0x00000004 4 JUMP_TABLE32 +CHECK: 0x00000008 2 JUMP_TABLE16 +CHECK: 0x0000000a 1 JUMP_TABLE8 diff --git a/test/tools/llvm-objdump/ARM/macho-private-headers.test b/test/tools/llvm-objdump/ARM/macho-private-headers.test new file mode 100644 index 0000000..4ab3043 --- /dev/null +++ b/test/tools/llvm-objdump/ARM/macho-private-headers.test @@ -0,0 +1,345 @@ +// RUN: llvm-objdump -p %p/Inputs/hello.obj.macho-arm | FileCheck %s +// RUN: llvm-objdump -p %p/Inputs/hello.exe.macho-arm \ +// RUN: | FileCheck %s -check-prefix=EXE + +CHECK: Mach header +CHECK: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags +CHECK: MH_MAGIC ARM V7 0x00 OBJECT 3 568 SUBSECTIONS_VIA_SYMBOLS +CHECK: Load command 0 +CHECK: cmd LC_SEGMENT +CHECK: cmdsize 464 +CHECK: segname +CHECK: vmaddr 0x00000000 +CHECK: vmsize 0x00000043 +CHECK: fileoff 596 +CHECK: filesize 67 +CHECK: maxprot rwx +CHECK: initprot rwx +CHECK: nsects 6 +CHECK: flags (none) +CHECK: Section +CHECK: sectname __text +CHECK: segname __TEXT +CHECK: addr 0x00000000 +CHECK: size 0x00000036 +CHECK: offset 596 +CHECK: align 2^2 (4) +CHECK: reloff 664 +CHECK: nreloc 5 +CHECK: type S_REGULAR +CHECK: attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS +CHECK: reserved1 0 +CHECK: reserved2 0 +CHECK: Section +CHECK: sectname __textcoal_nt +CHECK: segname __TEXT +CHECK: addr 0x00000036 +CHECK: size 0x00000000 +CHECK: offset 650 +CHECK: align 2^0 (1) +CHECK: reloff 0 +CHECK: nreloc 0 +CHECK: type S_COALESCED +CHECK: attributes PURE_INSTRUCTIONS +CHECK: reserved1 0 +CHECK: reserved2 0 +CHECK: Section +CHECK: sectname __const_coal +CHECK: segname __TEXT +CHECK: addr 0x00000036 +CHECK: size 0x00000000 +CHECK: offset 650 +CHECK: align 2^0 (1) +CHECK: reloff 0 +CHECK: nreloc 0 +CHECK: type S_COALESCED +CHECK: attributes (none) +CHECK: reserved1 0 +CHECK: reserved2 0 +CHECK: Section +CHECK: sectname __picsymbolstub4 +CHECK: segname __TEXT +CHECK: addr 0x00000036 +CHECK: size 0x00000000 +CHECK: offset 650 +CHECK: align 2^0 (1) +CHECK: reloff 0 +CHECK: nreloc 0 +CHECK: type S_SYMBOL_STUBS +CHECK: attributes (none) +CHECK: reserved1 0 (index into indirect symbol table) +CHECK: reserved2 16 (size of stubs) +CHECK: Section +CHECK: sectname __StaticInit +CHECK: segname __TEXT +CHECK: addr 0x00000036 +CHECK: size 0x00000000 +CHECK: offset 650 +CHECK: align 2^0 (1) +CHECK: reloff 0 +CHECK: nreloc 0 +CHECK: type S_REGULAR +CHECK: attributes PURE_INSTRUCTIONS +CHECK: reserved1 0 +CHECK: reserved2 0 +CHECK: Section +CHECK: sectname __cstring +CHECK: segname __TEXT +CHECK: addr 0x00000036 +CHECK: size 0x0000000d +CHECK: offset 650 +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: Load command 1 +CHECK: cmd LC_SYMTAB +CHECK: cmdsize 24 +CHECK: symoff 704 +CHECK: nsyms 2 +CHECK: stroff 728 +CHECK: strsize 16 +CHECK: Load command 2 +CHECK: cmd LC_DYSYMTAB +CHECK: cmdsize 80 +CHECK: ilocalsym 0 +CHECK: nlocalsym 0 +CHECK: iextdefsym 0 +CHECK: nextdefsym 1 +CHECK: iundefsym 1 +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 ARM V7 0x00 EXECUTE 17 1012 NOUNDEFS DYLDLINK TWOLEVEL PIE +EXE: Load command 0 +EXE: cmd LC_SEGMENT +EXE: cmdsize 56 +EXE: segname __PAGEZERO +EXE: vmaddr 0x00000000 +EXE: vmsize 0x00004000 +EXE: fileoff 0 +EXE: filesize 0 +EXE: maxprot --- +EXE: initprot --- +EXE: nsects 0 +EXE: flags (none) +EXE: Load command 1 +EXE: cmd LC_SEGMENT +EXE: cmdsize 328 +EXE: segname __TEXT +EXE: vmaddr 0x00004000 +EXE: vmsize 0x00008000 +EXE: fileoff 0 +EXE: filesize 32768 +EXE: maxprot r-x +EXE: initprot r-x +EXE: nsects 4 +EXE: flags (none) +EXE: Section +EXE: sectname __text +EXE: segname __TEXT +EXE: addr 0x0000bf84 +EXE: size 0x00000036 +EXE: offset 32644 +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 __stub_helper +EXE: segname __TEXT +EXE: addr 0x0000bfbc +EXE: size 0x00000030 +EXE: offset 32700 +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 0x0000bfec +EXE: size 0x0000000d +EXE: offset 32748 +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 __symbolstub1 +EXE: segname __TEXT +EXE: addr 0x0000bffc +EXE: size 0x00000004 +EXE: offset 32764 +EXE: align 2^2 (4) +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 4 (size of stubs) +EXE: Load command 2 +EXE: cmd LC_SEGMENT +EXE: cmdsize 192 +EXE: segname __DATA +EXE: vmaddr 0x0000c000 +EXE: vmsize 0x00004000 +EXE: fileoff 32768 +EXE: filesize 16384 +EXE: maxprot rw- +EXE: initprot rw- +EXE: nsects 2 +EXE: flags (none) +EXE: Section +EXE: sectname __lazy_symbol +EXE: segname __DATA +EXE: addr 0x0000c000 +EXE: size 0x00000004 +EXE: offset 32768 +EXE: align 2^2 (4) +EXE: reloff 0 +EXE: nreloc 0 +EXE: type S_LAZY_SYMBOL_POINTERS +EXE: attributes (none) +EXE: reserved1 1 (index into indirect symbol table) +EXE: reserved2 0 +EXE: Section +EXE: sectname __nl_symbol_ptr +EXE: segname __DATA +EXE: addr 0x0000c004 +EXE: size 0x00000008 +EXE: offset 32772 +EXE: align 2^2 (4) +EXE: reloff 0 +EXE: nreloc 0 +EXE: type S_NON_LAZY_SYMBOL_POINTERS +EXE: attributes (none) +EXE: reserved1 2 (index into indirect symbol table) +EXE: reserved2 0 +EXE: Load command 3 +EXE: cmd LC_SEGMENT +EXE: cmdsize 56 +EXE: segname __LINKEDIT +EXE: vmaddr 0x00010000 +EXE: vmsize 0x00004000 +EXE: fileoff 49152 +EXE: filesize 256 +EXE: maxprot r-- +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 49152 +EXE: rebase_size 4 +EXE: bind_off 49156 +EXE: bind_size 24 +EXE: weak_bind_off 0 +EXE: weak_bind_size 0 +EXE: lazy_bind_off 49180 +EXE: lazy_bind_size 16 +EXE: export_off 49196 +EXE: export_size 44 +EXE: Load command 5 +EXE: cmd LC_SYMTAB +EXE: cmdsize 24 +EXE: symoff 49264 +EXE: nsyms 5 +EXE: stroff 49340 +EXE: strsize 68 +EXE: Load command 6 +EXE: cmd LC_DYSYMTAB +EXE: cmdsize 80 +EXE: ilocalsym 0 +EXE: nlocalsym 1 +EXE: iextdefsym 1 +EXE: nextdefsym 2 +EXE: iundefsym 3 +EXE: nundefsym 2 +EXE: tocoff 0 +EXE: ntoc 0 +EXE: modtaboff 0 +EXE: nmodtab 0 +EXE: extrefsymoff 0 +EXE: nextrefsyms 0 +EXE: indirectsymoff 49324 +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 28 +EXE: name /usr/lib/dyld (offset 12) +EXE: Load command 8 +EXE: cmd LC_UUID +EXE: cmdsize 24 +EXE: uuid C2D9351C-1EF1-330B-A2AB-EED6CF7D2C5D +EXE: Load command 9 +EXE: cmd LC_VERSION_MIN_IPHONEOS +EXE: cmdsize 16 +EXE: version 8.0 +EXE: sdk 8.0 +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 32645 +EXE: stacksize 0 +EXE: Load command 12 +EXE: cmd LC_ENCRYPTION_INFO +EXE: cmdsize 20 +EXE: cryptoff 16384 +EXE: cryptsize 16384 +EXE: cryptid 0 +EXE: Load command 13 +EXE: cmd LC_LOAD_DYLIB +EXE: cmdsize 52 +EXE: name /usr/lib/libSystem.B.dylib (offset 24) +EXE: current version 1213.0.0 +EXE: compatibility version 1.0.0 +EXE: Load command 14 +EXE: cmd LC_FUNCTION_STARTS +EXE: cmdsize 16 +EXE: dataoff 49240 +EXE: datasize 4 +EXE: Load command 15 +EXE: cmd LC_DATA_IN_CODE +EXE: cmdsize 16 +EXE: dataoff 49244 +EXE: datasize 0 +EXE: Load command 16 +EXE: cmd LC_DYLIB_CODE_SIGN_DRS +EXE: cmdsize 16 +EXE: dataoff 49244 +EXE: datasize 20 diff --git a/test/tools/llvm-objdump/Inputs/common-symbol-elf b/test/tools/llvm-objdump/Inputs/common-symbol-elf Binary files differnew file mode 100644 index 0000000..9609edb --- /dev/null +++ b/test/tools/llvm-objdump/Inputs/common-symbol-elf diff --git a/test/tools/llvm-objdump/Inputs/proc-specific-section-elf b/test/tools/llvm-objdump/Inputs/proc-specific-section-elf Binary files differnew file mode 100644 index 0000000..7c3d613 --- /dev/null +++ b/test/tools/llvm-objdump/Inputs/proc-specific-section-elf diff --git a/test/tools/llvm-objdump/X86/Inputs/dylibModInit.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/dylibModInit.macho-x86_64 Binary files differnew file mode 100755 index 0000000..a39424a --- /dev/null +++ b/test/tools/llvm-objdump/X86/Inputs/dylibModInit.macho-x86_64 diff --git a/test/tools/llvm-objdump/X86/Inputs/dylibRoutines.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/dylibRoutines.macho-x86_64 Binary files differnew file mode 100755 index 0000000..3568045 --- /dev/null +++ b/test/tools/llvm-objdump/X86/Inputs/dylibRoutines.macho-x86_64 diff --git a/test/tools/llvm-objdump/X86/Inputs/dylibSubClient.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/dylibSubClient.macho-x86_64 Binary files differnew file mode 100755 index 0000000..e7f9542 --- /dev/null +++ b/test/tools/llvm-objdump/X86/Inputs/dylibSubClient.macho-x86_64 diff --git a/test/tools/llvm-objdump/X86/Inputs/dylibSubFramework.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/dylibSubFramework.macho-x86_64 Binary files differnew file mode 100755 index 0000000..3036c27 --- /dev/null +++ b/test/tools/llvm-objdump/X86/Inputs/dylibSubFramework.macho-x86_64 diff --git a/test/tools/llvm-objdump/X86/Inputs/dylibSubLibrary.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/dylibSubLibrary.macho-x86_64 Binary files differnew file mode 100755 index 0000000..dafee5f --- /dev/null +++ b/test/tools/llvm-objdump/X86/Inputs/dylibSubLibrary.macho-x86_64 diff --git a/test/tools/llvm-objdump/X86/Inputs/dylibSubUmbrella.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/dylibSubUmbrella.macho-x86_64 Binary files differnew file mode 100755 index 0000000..1e42a4f --- /dev/null +++ b/test/tools/llvm-objdump/X86/Inputs/dylibSubUmbrella.macho-x86_64 diff --git a/test/tools/llvm-objdump/X86/Inputs/exeThread.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/exeThread.macho-x86_64 Binary files differnew file mode 100755 index 0000000..93fe1db --- /dev/null +++ b/test/tools/llvm-objdump/X86/Inputs/exeThread.macho-x86_64 diff --git a/test/tools/llvm-objdump/X86/Inputs/linkerOption.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/linkerOption.macho-x86_64 Binary files differnew file mode 100644 index 0000000..38053c5 --- /dev/null +++ b/test/tools/llvm-objdump/X86/Inputs/linkerOption.macho-x86_64 diff --git a/test/tools/llvm-objdump/X86/Inputs/macho-universal-archive.x86_64.i386 b/test/tools/llvm-objdump/X86/Inputs/macho-universal-archive.x86_64.i386 Binary files differnew file mode 100644 index 0000000..1660714 --- /dev/null +++ b/test/tools/llvm-objdump/X86/Inputs/macho-universal-archive.x86_64.i386 diff --git a/test/tools/llvm-objdump/X86/Inputs/macho-universal.x86_64.i386 b/test/tools/llvm-objdump/X86/Inputs/macho-universal.x86_64.i386 Binary files differnew file mode 100755 index 0000000..36d5fc2 --- /dev/null +++ b/test/tools/llvm-objdump/X86/Inputs/macho-universal.x86_64.i386 diff --git a/test/tools/llvm-objdump/X86/macho-archive-headers.test b/test/tools/llvm-objdump/X86/macho-archive-headers.test new file mode 100644 index 0000000..3d9043e --- /dev/null +++ b/test/tools/llvm-objdump/X86/macho-archive-headers.test @@ -0,0 +1,10 @@ +RUN: llvm-objdump %p/Inputs/macho-universal-archive.x86_64.i386 -macho -archive-headers -arch all \ +RUN: | FileCheck %s + +# Note the date as printed by ctime(3) is time zone dependent and not checked. +CHECK: Archive : {{.*}}/macho-universal-archive.x86_64.i386 (architecture x86_64) +CHECK: -rw-r--r--124/11 44 {{.*}} __.SYMDEF SORTED +CHECK: -rw-r--r--124/0 860 {{.*}} hello.o +CHECK: Archive : {{.*}}/macho-universal-archive.x86_64.i386 (architecture i386) +CHECK: -rw-r--r--124/11 60 {{.*}} __.SYMDEF SORTED +CHECK: -rw-r--r--124/0 388 {{.*}} foo.o diff --git a/test/tools/llvm-objdump/X86/macho-cstring-dump.test b/test/tools/llvm-objdump/X86/macho-cstring-dump.test new file mode 100644 index 0000000..3dfa4e3 --- /dev/null +++ b/test/tools/llvm-objdump/X86/macho-cstring-dump.test @@ -0,0 +1,4 @@ +RUN: llvm-objdump -m -section __TEXT,__cstring %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s + +CHECK: Contents of (__TEXT,__cstring) section +CHECK: 000000000000003b Hello world\n diff --git a/test/tools/llvm-objdump/X86/macho-indirect-symbols.test b/test/tools/llvm-objdump/X86/macho-indirect-symbols.test new file mode 100644 index 0000000..4f3af18 --- /dev/null +++ b/test/tools/llvm-objdump/X86/macho-indirect-symbols.test @@ -0,0 +1,12 @@ +RUN: llvm-objdump -macho -indirect-symbols %p/Inputs/hello.exe.macho-x86_64 | FileCheck %s + +CHECK: Indirect symbols for (__TEXT,__stubs) 1 entries +CHECK: address index name +CHECK: 0x0000000100000f6c 2 _printf +CHECK: Indirect symbols for (__DATA,__nl_symbol_ptr) 2 entries +CHECK: address index name +CHECK: 0x0000000100001000 3 dyld_stub_binder +CHECK: 0x0000000100001008 ABSOLUTE +CHECK: Indirect symbols for (__DATA,__la_symbol_ptr) 1 entries +CHECK: address index name +CHECK: 0x0000000100001010 2 _printf diff --git a/test/tools/llvm-objdump/X86/macho-literal-pointers-i386.test b/test/tools/llvm-objdump/X86/macho-literal-pointers-i386.test new file mode 100644 index 0000000..0069668 --- /dev/null +++ b/test/tools/llvm-objdump/X86/macho-literal-pointers-i386.test @@ -0,0 +1,34 @@ +# RUN: llvm-mc < %s -triple i386-apple-darwin -filetype=obj | llvm-objdump -m -section __DATA,__litp - | FileCheck %s + +.cstring +L1: .asciz "Hello world\n" + +.literal4 +.align 2 +L2: .float 4.0 + +.literal8 +.align 3 +L3: .double 8.0 + +.literal16 +.align 4 +L4: .long 0x10000016, 0x20000016, 0x30000016, 0x40000016 + +.const +L5: .asciz "const non-literal string" + +.section __DATA,__litp, literal_pointers +.align 2 +.long L1 +.long L2 +.long L3 +.long L4 +.long L5 + +# CHECK: Contents of (__DATA,__litp) section +# CHECK: 0000004c __TEXT:__cstring:Hello world\n +# CHECK: 00000050 __TEXT:__literal4:0x40800000 +# CHECK: 00000054 __TEXT:__literal8:0x00000000 0x40200000 +# CHECK: 00000058 __TEXT:__literal16:0x10000016 0x20000016 0x30000016 0x40000016 +# CHECK: 0000005c 0x30 (not in a literal section) diff --git a/test/tools/llvm-objdump/X86/macho-literal-pointers-x86_64.test b/test/tools/llvm-objdump/X86/macho-literal-pointers-x86_64.test new file mode 100644 index 0000000..b403b81 --- /dev/null +++ b/test/tools/llvm-objdump/X86/macho-literal-pointers-x86_64.test @@ -0,0 +1,34 @@ +# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -section __DATA,__litp - | FileCheck %s + +.cstring +L1: .asciz "Hello world\n" + +.literal4 +.align 2 +L2: .float 4.0 + +.literal8 +.align 3 +L3: .double 8.0 + +.literal16 +.align 4 +L4: .long 0x10000016, 0x20000016, 0x30000016, 0x40000016 + +.const +L5: .asciz "const non-literal string" + +.section __DATA,__litp, literal_pointers +.align 3 +.quad L1 +.quad L2 +.quad L3 +.quad L4 +.quad L5 + +# CHECK: Contents of (__DATA,__litp) section +# CHECK: 0000000000000050 __TEXT:__cstring:Hello world\n +# CHECK: 0000000000000058 __TEXT:__literal4:0x40800000 +# CHECK: 0000000000000060 __TEXT:__literal8:0x00000000 0x40200000 +# CHECK: 0000000000000068 __TEXT:__literal16:0x10000016 0x20000016 0x30000016 0x40000016 +# CHECK: 0000000000000070 0x30 (not in a literal section) diff --git a/test/tools/llvm-objdump/X86/macho-literals.test b/test/tools/llvm-objdump/X86/macho-literals.test new file mode 100644 index 0000000..4824453 --- /dev/null +++ b/test/tools/llvm-objdump/X86/macho-literals.test @@ -0,0 +1,48 @@ +# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -section __TEXT,__literal4 - | FileCheck %s -check-prefix=CHECK-LIT4 +# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -section __TEXT,__literal8 - | FileCheck %s -check-prefix=CHECK-LIT8 +# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -section __TEXT,__literal16 - | FileCheck %s -check-prefix=CHECK-LIT16 + +.literal4 +.float 2.5 +.float 8.25 +.long 0x7f800000 +.long 0xff800000 +.long 0x7fc00000 +.long 0x7f800001 + +# CHECK-LIT4: Contents of (__TEXT,__literal4) section +# CHECK-LIT4: 0000000000000000 0x40200000 +# CHECK-LIT4: 0000000000000004 0x41040000 +# CHECK-LIT4: 0000000000000008 0x7f800000 +# CHECK-LIT4: 000000000000000c 0xff800000 +# CHECK-LIT4: 0000000000000010 0x7fc00000 +# CHECK-LIT4: 0000000000000014 0x7f800001 + +.literal8 +.double 2.5 +.double 8.25 +.long 0 +.long 0x7ff00000 +.long 0 +.long 0xfff00000 +.long 0 +.long 0x7ff80000 +.long 1 +.long 0x7ff00000 + +# CHECK-LIT8: Contents of (__TEXT,__literal8) section +# CHECK-LIT8: 0000000000000018 0x00000000 0x40040000 +# CHECK-LIT8: 0000000000000020 0x00000000 0x40208000 +# CHECK-LIT8: 0000000000000028 0x00000000 0x7ff00000 +# CHECK-LIT8: 0000000000000030 0x00000000 0xfff00000 +# CHECK-LIT8: 0000000000000038 0x00000000 0x7ff80000 +# CHECK-LIT8: 0000000000000040 0x00000001 0x7ff00000 + +.literal16 +.long 1 +.long 2 +.long 3 +.long 4 + +# CHECK-LIT16: Contents of (__TEXT,__literal16) section +# CHECK-LIT16: 0000000000000050 0x00000001 0x00000002 0x00000003 0x00000004 diff --git a/test/tools/llvm-objdump/X86/macho-nontext-disasm.test b/test/tools/llvm-objdump/X86/macho-nontext-disasm.test new file mode 100644 index 0000000..27b7bb4 --- /dev/null +++ b/test/tools/llvm-objdump/X86/macho-nontext-disasm.test @@ -0,0 +1,9 @@ +# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -section __FOO,__bar -full-leading-addr -print-imm-hex -no-show-raw-insn - | FileCheck %s + +.section __FOO, __bar +_foo: + nop + +# CHECK: Contents of (__FOO,__bar) section +# CHECK: _foo: +# CHECK: 0000000000000000 nop diff --git a/test/tools/llvm-objdump/X86/macho-private-headers.test b/test/tools/llvm-objdump/X86/macho-private-headers.test index 685b4f7..c80bb08 100644 --- a/test/tools/llvm-objdump/X86/macho-private-headers.test +++ b/test/tools/llvm-objdump/X86/macho-private-headers.test @@ -3,6 +3,22 @@ // RUN: | FileCheck %s -check-prefix=EXE // RUN: llvm-objdump -p %p/Inputs/dylibLoadKinds.macho-x86_64 \ // RUN: | FileCheck %s -check-prefix=LOAD +// RUN: llvm-objdump -p %p/Inputs/linkerOption.macho-x86_64 \ +// RUN: | FileCheck %s -check-prefix=LD_OPT +// RUN: llvm-objdump -p %p/Inputs/dylibSubFramework.macho-x86_64 \ +// RUN: | FileCheck %s -check-prefix=SUB_FRAME +// RUN: llvm-objdump -p %p/Inputs/dylibSubUmbrella.macho-x86_64 \ +// RUN: | FileCheck %s -check-prefix=SUB_UMB +// RUN: llvm-objdump -p %p/Inputs/dylibSubLibrary.macho-x86_64 \ +// RUN: | FileCheck %s -check-prefix=SUB_LIB +// RUN: llvm-objdump -p %p/Inputs/dylibSubClient.macho-x86_64 \ +// RUN: | FileCheck %s -check-prefix=SUB_CLI +// RUN: llvm-objdump -p %p/Inputs/dylibRoutines.macho-x86_64 \ +// RUN: | FileCheck %s -check-prefix=ROUTINE +// RUN: llvm-objdump -p %p/Inputs/exeThread.macho-x86_64 \ +// RUN: | FileCheck %s -check-prefix=THREAD +// RUN: llvm-objdump -macho -p -arch i386 %p/Inputs/macho-universal.x86_64.i386 \ +// RUN: | FileCheck %s -check-prefix=FATi386 CHECK: Mach header CHECK: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags @@ -366,3 +382,64 @@ LOAD: name /usr/lib/foo4.dylib (offset 24) LOAD: current version 0.0.0 LOAD: compatibility version 0.0.0 +LD_OPT: Load command 4 +LD_OPT: cmd LC_LINKER_OPTION +LD_OPT: cmdsize 24 +LD_OPT: count 1 +LD_OPT: string #1 -lc++ +LD_OPT: Load command 5 +LD_OPT: cmd LC_LINKER_OPTION +LD_OPT: cmdsize 40 +LD_OPT: count 2 +LD_OPT: string #1 -framework +LD_OPT: string #2 Foundation + +SUB_FRAME: Load command 10 +SUB_FRAME: cmd LC_SUB_FRAMEWORK +SUB_FRAME: cmdsize 16 +SUB_FRAME: umbrella Bar (offset 12) + +SUB_UMB: Load command 5 +SUB_UMB: cmd LC_SUB_UMBRELLA +SUB_UMB: cmdsize 16 +SUB_UMB: sub_umbrella Foo (offset 12) + +SUB_LIB: Load command 5 +SUB_LIB: cmd LC_SUB_LIBRARY +SUB_LIB: cmdsize 20 +SUB_LIB: sub_library libfoo (offset 12) + +SUB_CLI: Load command 10 +SUB_CLI: cmd LC_SUB_CLIENT +SUB_CLI: cmdsize 16 +SUB_CLI: client bar (offset 12) + +ROUTINE: Load command 6 +ROUTINE: cmd LC_ROUTINES_64 +ROUTINE: cmdsize 72 +ROUTINE: init_address 0x0000000000000f80 +ROUTINE: init_module 0 +ROUTINE: reserved1 0 +ROUTINE: reserved2 0 +ROUTINE: reserved3 0 +ROUTINE: reserved4 0 +ROUTINE: reserved5 0 +ROUTINE: reserved6 0 + +THREAD: Load command 10 +THREAD: cmd LC_UNIXTHREAD +THREAD: cmdsize 184 +THREAD: flavor x86_THREAD_STATE64 +THREAD: count x86_THREAD_STATE64_COUNT +THREAD: rax 0x0000000000000000 rbx 0x0000000000000000 rcx 0x0000000000000000 +THREAD: rdx 0x0000000000000000 rdi 0x0000000000000000 rsi 0x0000000000000000 +THREAD: rbp 0x0000000000000000 rsp 0x0000000000000000 r8 0x0000000000000000 +THREAD: r9 0x0000000000000000 r10 0x0000000000000000 r11 0x0000000000000000 +THREAD: r12 0x0000000000000000 r13 0x0000000000000000 r14 0x0000000000000000 +THREAD: r15 0x0000000000000000 rip 0x0000000100000d00 +THREAD: rflags 0x0000000000000000 cs 0x0000000000000000 fs 0x0000000000000000 +THREAD: gs 0x0000000000000000 + +FATi386: Mach header +FATi386: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags +FATi386: MH_MAGIC I386 ALL 0x00 EXECUTE 16 716 NOUNDEFS DYLDLINK TWOLEVEL PIE MH_NO_HEAP_EXECUTION diff --git a/test/tools/llvm-objdump/X86/macho-relocations.test b/test/tools/llvm-objdump/X86/macho-relocations.test new file mode 100644 index 0000000..536aec8 --- /dev/null +++ b/test/tools/llvm-objdump/X86/macho-relocations.test @@ -0,0 +1,7 @@ +RUN: llvm-objdump -macho -r %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s + +CHECK: RELOCATION RECORDS FOR [__text]: +CHECK: 0000000000000027 X86_64_RELOC_BRANCH _printf +CHECK: 000000000000000b X86_64_RELOC_SIGNED L_.str +CHECK: RELOCATION RECORDS FOR [__compact_unwind]: +CHECK: 0000000000000000 X86_64_RELOC_UNSIGNED __text diff --git a/test/tools/llvm-objdump/X86/macho-section-contents.test b/test/tools/llvm-objdump/X86/macho-section-contents.test new file mode 100644 index 0000000..f62b5a7 --- /dev/null +++ b/test/tools/llvm-objdump/X86/macho-section-contents.test @@ -0,0 +1,17 @@ +RUN: llvm-objdump -macho -s %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s + +CHECK: Contents of section __text: +CHECK: 0000 554889e5 4883ec20 488d0500 000000c7 UH..H.. H....... +CHECK: 0010 45fc0000 0000897d f8488975 f0488955 E......}.H.u.H.U +CHECK: 0020 e84889c7 b000e800 000000b9 00000000 .H.............. +CHECK: 0030 8945e489 c84883c4 205dc3 .E...H.. ]. +CHECK: Contents of section __cstring: +CHECK: 003b 48656c6c 6f20776f 726c640a 00 Hello world.. +CHECK: Contents of section __compact_unwind: +CHECK: 0048 00000000 00000000 3b000000 00000001 ........;....... +CHECK: 0058 00000000 00000000 00000000 00000000 ................ +CHECK: Contents of section __eh_frame: +CHECK: 0068 14000000 00000000 017a5200 01781001 .........zR..x.. +CHECK: 0078 100c0708 90010000 24000000 1c000000 ........$....... +CHECK: 0088 78ffffff ffffffff 3b000000 00000000 x.......;....... +CHECK: 0098 00410e10 8602430d 06000000 00000000 .A....C......... diff --git a/test/tools/llvm-objdump/X86/macho-section-headers.test b/test/tools/llvm-objdump/X86/macho-section-headers.test new file mode 100644 index 0000000..5159d18 --- /dev/null +++ b/test/tools/llvm-objdump/X86/macho-section-headers.test @@ -0,0 +1,8 @@ +RUN: llvm-objdump -macho -h %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s + +CHECK: Sections: +CHECK: Idx Name Size Address Type +CHECK: 0 __text 0000003b 0000000000000000 TEXT +CHECK: 1 __cstring 0000000d 000000000000003b DATA +CHECK: 2 __compact_unwind 00000020 0000000000000048 DATA +CHECK: 3 __eh_frame 00000040 0000000000000068 DATA diff --git a/test/tools/llvm-objdump/X86/macho-section.test b/test/tools/llvm-objdump/X86/macho-section.test new file mode 100644 index 0000000..720b9a4 --- /dev/null +++ b/test/tools/llvm-objdump/X86/macho-section.test @@ -0,0 +1,4 @@ +// RUN: llvm-objdump -m -section __DATA,__mod_init_func %p/Inputs/dylibModInit.macho-x86_64 | FileCheck %s -check-prefix=MODINIT + +MODINIT: Contents of (__DATA,__mod_init_func) section +MODINIT: 0x0000000000001000 0x0000000000000f30 _libinit diff --git a/test/tools/llvm-objdump/X86/macho-symbol-table.test b/test/tools/llvm-objdump/X86/macho-symbol-table.test new file mode 100644 index 0000000..5b9a4f8 --- /dev/null +++ b/test/tools/llvm-objdump/X86/macho-symbol-table.test @@ -0,0 +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 0000000d L_.str +CHECK: 0000000000000068 l F __TEXT,__eh_frame 00000018 EH_frame0 +CHECK: 0000000000000000 g F __TEXT,__text 0000003b _main +CHECK: 0000000000000080 g F __TEXT,__eh_frame 00000028 _main.eh +CHECK: 0000000000000000 *UND* 00000000 _printf diff --git a/test/tools/llvm-objdump/X86/macho-universal-x86_64.i386.test b/test/tools/llvm-objdump/X86/macho-universal-x86_64.i386.test new file mode 100644 index 0000000..e4fd37a --- /dev/null +++ b/test/tools/llvm-objdump/X86/macho-universal-x86_64.i386.test @@ -0,0 +1,44 @@ +RUN: llvm-objdump %p/Inputs/macho-universal.x86_64.i386 -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex -arch all \ +RUN: | FileCheck %s -check-prefix UEXE-all +RUN: llvm-objdump %p/Inputs/macho-universal-archive.x86_64.i386 -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex -arch i386 \ +RUN: | FileCheck %s -check-prefix UArchive-i386 +RUN: llvm-objdump %p/Inputs/macho-universal.x86_64.i386 -universal-headers -m \ +RUN: | FileCheck %s -check-prefix FAT + +UEXE-all: macho-universal.x86_64.i386 (architecture x86_64): +UEXE-all: (__TEXT,__text) section +UEXE-all: _main: +UEXE-all: 0000000100000f60 pushq %rbp +UEXE-all: 0000000100000f61 movq %rsp, %rbp +UEXE-all: macho-universal.x86_64.i386 (architecture i386): +UEXE-all: (__TEXT,__text) section +UEXE-all: _main: +UEXE-all: 00001fa0 pushl %ebp +UEXE-all: 00001fa1 movl %esp, %ebp + +UArchive-i386: Archive : {{.*}}/macho-universal-archive.x86_64.i386 +UArchive-i386: macho-universal-archive.x86_64.i386(foo.o): +UArchive-i386: (__TEXT,__text) section +UArchive-i386: _foo: +UArchive-i386: 00000000 pushl %ebp +UArchive-i386: 00000001 movl %esp, %ebp +UArchive-i386: 00000003 popl %ebp +UArchive-i386: 00000004 retl + +FAT: Fat headers +FAT: fat_magic FAT_MAGIC +FAT: nfat_arch 2 +FAT: architecture x86_64 +FAT: cputype CPU_TYPE_X86_64 +FAT: cpusubtype CPU_SUBTYPE_X86_64_ALL +FAT: capabilities CPU_SUBTYPE_LIB64 +FAT: offset 4096 +FAT: size 4360 +FAT: align 2^12 (4096) +FAT: architecture i386 +FAT: cputype CPU_TYPE_I386 +FAT: cpusubtype CPU_SUBTYPE_I386_ALL +FAT: capabilities 0x0 +FAT: offset 12288 +FAT: size 4336 +FAT: align 2^12 (4096) diff --git a/test/tools/llvm-objdump/X86/macho-unwind-info.test b/test/tools/llvm-objdump/X86/macho-unwind-info.test new file mode 100644 index 0000000..33db84f --- /dev/null +++ b/test/tools/llvm-objdump/X86/macho-unwind-info.test @@ -0,0 +1,7 @@ +RUN: llvm-objdump -macho -u %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s + +CHECK: Contents of __compact_unwind section: +CHECK: Entry at offset 0x0: +CHECK: start: 0x0 _main +CHECK: length: 0x3b +CHECK: compact encoding: 0x01000000 diff --git a/test/tools/llvm-objdump/common-symbol-elf.test b/test/tools/llvm-objdump/common-symbol-elf.test new file mode 100644 index 0000000..32df05a --- /dev/null +++ b/test/tools/llvm-objdump/common-symbol-elf.test @@ -0,0 +1,3 @@ +// RUN: llvm-objdump -t %p/Inputs/common-symbol-elf | FileCheck %s + +CHECK: 00000400 g *COM* 00000008 common_symbol diff --git a/test/tools/llvm-objdump/proc-specific-section-elf.test b/test/tools/llvm-objdump/proc-specific-section-elf.test new file mode 100644 index 0000000..b3067d4 --- /dev/null +++ b/test/tools/llvm-objdump/proc-specific-section-elf.test @@ -0,0 +1,3 @@ +// RUN: llvm-objdump -t %p/Inputs/proc-specific-section-elf | FileCheck %s + +CHECK: 00000000 *UND* 00000000 print |