diff options
Diffstat (limited to 'test/MC/MachO')
41 files changed, 1055 insertions, 117 deletions
diff --git a/test/MC/MachO/absolutize.s b/test/MC/MachO/absolutize.s index 76acd5b..39571dd 100644 --- a/test/MC/MachO/absolutize.s +++ b/test/MC/MachO/absolutize.s @@ -50,7 +50,7 @@ Ldata_expr_2 = Ldata_d - Ldata_c // CHECK: ('cputype', 7) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 296) // CHECK: ('flag', 0) // CHECK: ('load_commands', [ @@ -103,7 +103,7 @@ Ldata_expr_2 = Ldata_d - Ldata_c // CHECK: (('word-0', 0xa1000000), // CHECK: ('word-1', 0x2)), // CHECK: ]) -// CHECK: ('_section_data', '1\xc01\xc01\xc01\xc0\xb8\xfe\xff\xff\xff\xb8\xfe\xff\xff\xff\xb8\x02\x00\x00\x00\xb8\x02\x00\x00\x00\xb8\x02\x00\x00\x00\xb8\x02\x00\x00\x00\xb8\xfe\xff\xff\xff') +// CHECK: ('_section_data', '31c031c0 31c031c0 b8feffff ffb8feff ffffb802 000000b8 02000000 b8020000 00b80200 0000b8fe ffffff') // CHECK: # Section 1 // CHECK: (('section_name', '__data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') // CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') @@ -140,7 +140,7 @@ Ldata_expr_2 = Ldata_d - Ldata_c // CHECK: (('word-0', 0xa1000000), // CHECK: ('word-1', 0x2f)), // CHECK: ]) -// CHECK: ('_section_data', "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfc\xff\xff\xff\xfc\xff\xff\xff\x04\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00'\x00\x00\x00") +// CHECK: ('_section_data', '00000000 00000000 00000000 00000000 fcffffff fcffffff 04000000 04000000 04000000 04000000 27000000') // CHECK: ]) // CHECK: ), // CHECK: # Load Command 1 diff --git a/test/MC/MachO/comm-1.s b/test/MC/MachO/comm-1.s index e979fb1..5ffa979 100644 --- a/test/MC/MachO/comm-1.s +++ b/test/MC/MachO/comm-1.s @@ -10,7 +10,7 @@ // CHECK: ('cputype', 7) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 228) // CHECK: ('flag', 0) // CHECK: ('load_commands', [ diff --git a/test/MC/MachO/darwin-ARM-reloc.s b/test/MC/MachO/darwin-ARM-reloc.s new file mode 100644 index 0000000..86b45e0 --- /dev/null +++ b/test/MC/MachO/darwin-ARM-reloc.s @@ -0,0 +1,171 @@ +@ RUN: llvm-mc -n -triple armv7-apple-darwin10 %s -filetype=obj -o %t.obj +@ RUN: macho-dump --dump-section-data < %t.obj > %t.dump +@ RUN: FileCheck < %t.dump %s + + .syntax unified + .text +_f0: + bl _printf + +_f1: + bl _f0 + + .data +_d0: +Ld0_0: + .long Lsc0_0 - Ld0_0 + + .section __TEXT,__cstring,cstring_literals +Lsc0_0: + .long 0 + +@ CHECK: ('cputype', 12) +@ CHECK: ('cpusubtype', 9) +@ CHECK: ('filetype', 1) +@ CHECK: ('num_load_commands', 3) +@ CHECK: ('load_commands_size', 364) +@ CHECK: ('flag', 0) +@ CHECK: ('load_commands', [ +@ CHECK: # Load Command 0 +@ CHECK: (('command', 1) +@ CHECK: ('size', 260) +@ CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +@ CHECK: ('vm_addr', 0) +@ CHECK: ('vm_size', 16) +@ CHECK: ('file_offset', 392) +@ CHECK: ('file_size', 16) +@ CHECK: ('maxprot', 7) +@ CHECK: ('initprot', 7) +@ CHECK: ('num_sections', 3) +@ CHECK: ('flags', 0) +@ CHECK: ('sections', [ +@ CHECK: # Section 0 +@ CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +@ CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +@ CHECK: ('address', 0) +@ CHECK: ('size', 8) +@ CHECK: ('offset', 392) +@ CHECK: ('alignment', 0) +@ CHECK: ('reloc_offset', 408) +@ CHECK: ('num_reloc', 2) +@ CHECK: ('flags', 0x80000400) +@ CHECK: ('reserved1', 0) +@ CHECK: ('reserved2', 0) +@ CHECK: ), +@ CHECK: ('_relocations', [ +@ CHECK: # Relocation 0 +@ CHECK: (('word-0', 0x4), +@ CHECK: ('word-1', 0x55000001)), +@ CHECK: # Relocation 1 +@ CHECK: (('word-0', 0x0), +@ CHECK: ('word-1', 0x5d000003)), +@ CHECK: ]) +@ CHECK: ('_section_data', 'feffffeb fdffffeb') +@ CHECK: # Section 1 +@ CHECK: (('section_name', '__data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +@ CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +@ CHECK: ('address', 8) +@ CHECK: ('size', 4) +@ CHECK: ('offset', 400) +@ CHECK: ('alignment', 0) +@ CHECK: ('reloc_offset', 424) +@ CHECK: ('num_reloc', 2) +@ CHECK: ('flags', 0x0) +@ CHECK: ('reserved1', 0) +@ CHECK: ('reserved2', 0) +@ CHECK: ), +@ CHECK: ('_relocations', [ +@ CHECK: # Relocation 0 +@ CHECK: (('word-0', 0xa2000000), +@ CHECK: ('word-1', 0xc)), +@ CHECK: # Relocation 1 +@ CHECK: (('word-0', 0xa1000000), +@ CHECK: ('word-1', 0x8)), +@ CHECK: ]) +@ CHECK: ('_section_data', '04000000') +@ CHECK: # Section 2 +@ CHECK: (('section_name', '__cstring\x00\x00\x00\x00\x00\x00\x00') +@ CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +@ CHECK: ('address', 12) +@ CHECK: ('size', 4) +@ CHECK: ('offset', 404) +@ CHECK: ('alignment', 0) +@ CHECK: ('reloc_offset', 0) +@ CHECK: ('num_reloc', 0) +@ CHECK: ('flags', 0x2) +@ CHECK: ('reserved1', 0) +@ CHECK: ('reserved2', 0) +@ CHECK: ), +@ CHECK: ('_relocations', [ +@ CHECK: ]) +@ CHECK: ('_section_data', '00000000') +@ CHECK: ]) +@ CHECK: ), +@ CHECK: # Load Command 1 +@ CHECK: (('command', 2) +@ CHECK: ('size', 24) +@ CHECK: ('symoff', 440) +@ CHECK: ('nsyms', 4) +@ CHECK: ('stroff', 488) +@ CHECK: ('strsize', 24) +@ CHECK: ('_string_data', '\x00_printf\x00_f0\x00_f1\x00_d0\x00\x00\x00\x00') +@ CHECK: ('_symbols', [ +@ CHECK: # Symbol 0 +@ CHECK: (('n_strx', 9) +@ CHECK: ('n_type', 0xe) +@ CHECK: ('n_sect', 1) +@ CHECK: ('n_desc', 0) +@ CHECK: ('n_value', 0) +@ CHECK: ('_string', '_f0') +@ CHECK: ), +@ CHECK: # Symbol 1 +@ CHECK: (('n_strx', 13) +@ CHECK: ('n_type', 0xe) +@ CHECK: ('n_sect', 1) +@ CHECK: ('n_desc', 0) +@ CHECK: ('n_value', 4) +@ CHECK: ('_string', '_f1') +@ CHECK: ), +@ CHECK: # Symbol 2 +@ CHECK: (('n_strx', 17) +@ CHECK: ('n_type', 0xe) +@ CHECK: ('n_sect', 2) +@ CHECK: ('n_desc', 0) +@ CHECK: ('n_value', 8) +@ CHECK: ('_string', '_d0') +@ CHECK: ), +@ CHECK: # Symbol 3 +@ CHECK: (('n_strx', 1) +@ CHECK: ('n_type', 0x1) +@ CHECK: ('n_sect', 0) +@ CHECK: ('n_desc', 0) +@ CHECK: ('n_value', 0) +@ CHECK: ('_string', '_printf') +@ CHECK: ), +@ CHECK: ]) +@ CHECK: ), +@ CHECK: # Load Command 2 +@ CHECK: (('command', 11) +@ CHECK: ('size', 80) +@ CHECK: ('ilocalsym', 0) +@ CHECK: ('nlocalsym', 3) +@ CHECK: ('iextdefsym', 3) +@ CHECK: ('nextdefsym', 0) +@ CHECK: ('iundefsym', 3) +@ 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) +@ CHECK: ('_indirect_symbols', [ +@ CHECK: ]) +@ CHECK: ), +@ CHECK: ]) diff --git a/test/MC/MachO/darwin-Thumb-reloc.s b/test/MC/MachO/darwin-Thumb-reloc.s new file mode 100644 index 0000000..567573d --- /dev/null +++ b/test/MC/MachO/darwin-Thumb-reloc.s @@ -0,0 +1,139 @@ +@ RUN: llvm-mc -n -triple thumbv7-apple-darwin10 %s -filetype=obj -o %t.obj +@ RUN: macho-dump --dump-section-data < %t.obj > %t.dump +@ RUN: FileCheck < %t.dump %s + + .syntax unified + .section __TEXT,__text,regular,pure_instructions + .globl _main + .align 2 + .code 16 + .thumb_func _main +_main: +LPC0_0: + blx _printf + .align 2 +LCPI0_0: + .long L_.str-(LPC0_0+4) + + .section __TEXT,__cstring,cstring_literals + .align 2 +L_.str: + .asciz "s0" + +.subsections_via_symbols + +@ CHECK: ('cputype', 12) +@ CHECK: ('cpusubtype', 9) +@ CHECK: ('filetype', 1) +@ CHECK: ('num_load_commands', 3) +@ CHECK: ('load_commands_size', 296) +@ CHECK: ('flag', 8192) +@ CHECK: ('load_commands', [ +@ CHECK: # Load Command 0 +@ CHECK: (('command', 1) +@ CHECK: ('size', 192) +@ CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +@ CHECK: ('vm_addr', 0) +@ CHECK: ('vm_size', 11) +@ CHECK: ('file_offset', 324) +@ CHECK: ('file_size', 11) +@ CHECK: ('maxprot', 7) +@ CHECK: ('initprot', 7) +@ CHECK: ('num_sections', 2) +@ CHECK: ('flags', 0) +@ CHECK: ('sections', [ +@ CHECK: # Section 0 +@ CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +@ CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +@ CHECK: ('address', 0) +@ CHECK: ('size', 8) +@ CHECK: ('offset', 324) +@ CHECK: ('alignment', 2) +@ CHECK: ('reloc_offset', 336) +@ CHECK: ('num_reloc', 3) +@ CHECK: ('flags', 0x80000400) +@ CHECK: ('reserved1', 0) +@ CHECK: ('reserved2', 0) +@ CHECK: ), +@ CHECK: ('_relocations', [ +@ CHECK: # Relocation 0 +@ CHECK: (('word-0', 0xa2000004), +@ CHECK: ('word-1', 0x8)), +@ CHECK: # Relocation 1 +@ CHECK: (('word-0', 0xa1000000), +@ CHECK: ('word-1', 0x0)), +@ CHECK: # Relocation 2 +@ CHECK: (('word-0', 0x0), +@ CHECK: ('word-1', 0x6d000001)), +@ CHECK: ]) +@ CHECK-FIXME: ('_section_data', 'fff7feef 04000000') +@ CHECK: # Section 1 +@ CHECK: (('section_name', '__cstring\x00\x00\x00\x00\x00\x00\x00') +@ CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +@ CHECK: ('address', 8) +@ CHECK: ('size', 3) +@ CHECK: ('offset', 332) +@ CHECK: ('alignment', 2) +@ CHECK: ('reloc_offset', 0) +@ CHECK: ('num_reloc', 0) +@ CHECK: ('flags', 0x2) +@ CHECK: ('reserved1', 0) +@ CHECK: ('reserved2', 0) +@ CHECK: ), +@ CHECK: ('_relocations', [ +@ CHECK: ]) +@ CHECK: ('_section_data', '733000') +@ CHECK: ]) +@ CHECK: ), +@ CHECK: # Load Command 1 +@ CHECK: (('command', 2) +@ CHECK: ('size', 24) +@ CHECK: ('symoff', 360) +@ CHECK: ('nsyms', 2) +@ CHECK: ('stroff', 384) +@ CHECK: ('strsize', 16) +@ CHECK: ('_string_data', '\x00_main\x00_printf\x00\x00') +@ CHECK: ('_symbols', [ +@ CHECK: # Symbol 0 +@ CHECK: (('n_strx', 1) +@ CHECK: ('n_type', 0xf) +@ CHECK: ('n_sect', 1) +@ CHECK: ('n_desc', 8) +@ CHECK: ('n_value', 0) +@ CHECK: ('_string', '_main') +@ CHECK: ), +@ CHECK: # Symbol 1 +@ CHECK: (('n_strx', 7) +@ CHECK: ('n_type', 0x1) +@ CHECK: ('n_sect', 0) +@ CHECK: ('n_desc', 0) +@ CHECK: ('n_value', 0) +@ CHECK: ('_string', '_printf') +@ CHECK: ), +@ CHECK: ]) +@ CHECK: ), +@ CHECK: # Load Command 2 +@ CHECK: (('command', 11) +@ CHECK: ('size', 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) +@ CHECK: ('_indirect_symbols', [ +@ CHECK: ]) +@ CHECK: ), +@ CHECK: ]) diff --git a/test/MC/MachO/darwin-complex-difference.s b/test/MC/MachO/darwin-complex-difference.s new file mode 100644 index 0000000..e66bd09 --- /dev/null +++ b/test/MC/MachO/darwin-complex-difference.s @@ -0,0 +1,129 @@ +// RUN: llvm-mc -triple x86_64-apple-darwin10 %s -filetype=obj -o %t.o +// RUN: macho-dump --dump-section-data < %t.o > %t.dump +// RUN: FileCheck < %t.dump %s + +_a: +L0: + .long 1 +L1: + .long 2 + .long _c - _d + 4 + .long (_c - L0) - (_d - L1) // == (_c - _d) + (L1 - L0) + // == (_c - _d + 4) +_c: + .long 0 +_d: + .long 0 + +// CHECK: ('cputype', 16777223) +// CHECK: ('cpusubtype', 3) +// CHECK: ('filetype', 1) +// CHECK: ('num_load_commands', 3) +// CHECK: ('load_commands_size', 256) +// CHECK: ('flag', 0) +// CHECK: ('reserved', 0) +// CHECK: ('load_commands', [ +// CHECK: # Load Command 0 +// CHECK: (('command', 25) +// CHECK: ('size', 152) +// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('vm_addr', 0) +// CHECK: ('vm_size', 24) +// CHECK: ('file_offset', 288) +// CHECK: ('file_size', 24) +// CHECK: ('maxprot', 7) +// CHECK: ('initprot', 7) +// CHECK: ('num_sections', 1) +// CHECK: ('flags', 0) +// CHECK: ('sections', [ +// CHECK: # Section 0 +// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('address', 0) +// CHECK: ('size', 24) +// CHECK: ('offset', 288) +// CHECK: ('alignment', 0) +// CHECK: ('reloc_offset', 312) +// CHECK: ('num_reloc', 4) +// CHECK: ('flags', 0x80000000) +// CHECK: ('reserved1', 0) +// CHECK: ('reserved2', 0) +// CHECK: ('reserved3', 0) +// CHECK: ), +// CHECK: ('_relocations', [ +// CHECK: # Relocation 0 +// CHECK: (('word-0', 0xc), +// CHECK: ('word-1', 0x5c000002)), +// CHECK: # Relocation 1 +// CHECK: (('word-0', 0xc), +// CHECK: ('word-1', 0xc000001)), +// CHECK: # Relocation 2 +// CHECK: (('word-0', 0x8), +// CHECK: ('word-1', 0x5c000002)), +// CHECK: # Relocation 3 +// CHECK: (('word-0', 0x8), +// CHECK: ('word-1', 0xc000001)), +// CHECK: ]) +// CHECK: ('_section_data', '01000000 02000000 04000000 04000000 00000000 00000000') +// CHECK: ]) +// CHECK: ), +// CHECK: # Load Command 1 +// CHECK: (('command', 2) +// CHECK: ('size', 24) +// CHECK: ('symoff', 344) +// CHECK: ('nsyms', 3) +// CHECK: ('stroff', 392) +// CHECK: ('strsize', 12) +// CHECK: ('_string_data', '\x00_a\x00_c\x00_d\x00\x00\x00') +// CHECK: ('_symbols', [ +// CHECK: # Symbol 0 +// CHECK: (('n_strx', 1) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 1) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 0) +// CHECK: ('_string', '_a') +// CHECK: ), +// CHECK: # Symbol 1 +// CHECK: (('n_strx', 4) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 1) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 16) +// CHECK: ('_string', '_c') +// CHECK: ), +// CHECK: # Symbol 2 +// CHECK: (('n_strx', 7) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 1) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 20) +// CHECK: ('_string', '_d') +// CHECK: ), +// CHECK: ]) +// CHECK: ), +// CHECK: # Load Command 2 +// CHECK: (('command', 11) +// CHECK: ('size', 80) +// CHECK: ('ilocalsym', 0) +// CHECK: ('nlocalsym', 3) +// CHECK: ('iextdefsym', 3) +// CHECK: ('nextdefsym', 0) +// CHECK: ('iundefsym', 3) +// CHECK: ('nundefsym', 0) +// 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) +// CHECK: ('_indirect_symbols', [ +// CHECK: ]) +// CHECK: ), +// CHECK: ]) diff --git a/test/MC/MachO/darwin-x86_64-diff-relocs.s b/test/MC/MachO/darwin-x86_64-diff-relocs.s index 38fa074..449d2f5 100644 --- a/test/MC/MachO/darwin-x86_64-diff-relocs.s +++ b/test/MC/MachO/darwin-x86_64-diff-relocs.s @@ -120,7 +120,7 @@ L3: // CHECK: ('cputype', 16777223) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 336) // CHECK: ('flag', 0) // CHECK: ('reserved', 0) diff --git a/test/MC/MachO/darwin-x86_64-reloc-offsets.s b/test/MC/MachO/darwin-x86_64-reloc-offsets.s index ab6820e..f748064 100644 --- a/test/MC/MachO/darwin-x86_64-reloc-offsets.s +++ b/test/MC/MachO/darwin-x86_64-reloc-offsets.s @@ -117,7 +117,7 @@ L1: // CHECK: ('cputype', 16777223) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 336) // CHECK: ('flag', 0) // CHECK: ('reserved', 0) @@ -277,7 +277,7 @@ L1: // CHECK: (('word-0', 0x2), // CHECK: ('word-1', 0x6d000000)), // CHECK: ]) -// CHECK: ('_section_data', '\xc6\x05\xff\xff\xff\xff\x12\xc6\x05\x00\x00\x00\x00\x12\xc7\x05\xfc\xff\xff\xffxV4\x12\xc7\x05\xfd\xff\xff\xffxV4\x12\xc7\x05\xfe\xff\xff\xffxV4\x12\xc7\x05\xff\xff\xff\xffxV4\x12\xc7\x05\x00\x00\x00\x00xV4\x12\x88\x05\x00\x00\x00\x00\x88\x05\x01\x00\x00\x00\x89\x05\x00\x00\x00\x00\x89\x05\x01\x00\x00\x00\x89\x05\x02\x00\x00\x00\x89\x05\x03\x00\x00\x00\x89\x05\x04\x00\x00\x00\xc6\x05\xdd\x00\x00\x00\x12\xc6\x05\xd7\x00\x00\x00\x12\xc7\x05\xcc\x00\x00\x00xV4\x12\xc7\x05\xc3\x00\x00\x00xV4\x12\xc7\x05\xba\x00\x00\x00xV4\x12\xc7\x05\xb1\x00\x00\x00xV4\x12\xc7\x05\xa8\x00\x00\x00xV4\x12\x88\x05\x9e\x00\x00\x00\x88\x05\x99\x00\x00\x00\x89\x05\x92\x00\x00\x00\x89\x05\x8d\x00\x00\x00\x89\x05\x88\x00\x00\x00\x89\x05\x83\x00\x00\x00\x89\x05~\x00\x00\x00\xc6\x05\x03\x00\x00\x00\x12\xc6\x05\x04\x00\x00\x00\x12\xc7\x05\x00\x00\x00\x00xV4\x12\xc7\x05\x01\x00\x00\x00xV4\x12\xc7\x05\x02\x00\x00\x00xV4\x12\xc7\x05\x03\x00\x00\x00xV4\x12\xc7\x05\x04\x00\x00\x00xV4\x12\x88\x05\x04\x00\x00\x00\x88\x05\x05\x00\x00\x00\x89\x05\x04\x00\x00\x00\x89\x05\x05\x00\x00\x00\x89\x05\x06\x00\x00\x00\x89\x05\x07\x00\x00\x00\x89\x05\x08\x00\x00\x00') +// CHECK: ('_section_data', 'c605ffff ffff12c6 05000000 0012c705 fcffffff 78563412 c705fdff ffff7856 3412c705 feffffff 78563412 c705ffff ffff7856 3412c705 00000000 78563412 88050000 00008805 01000000 89050000 00008905 01000000 89050200 00008905 03000000 89050400 0000c605 dd000000 12c605d7 00000012 c705cc00 00007856 3412c705 c3000000 78563412 c705ba00 00007856 3412c705 b1000000 78563412 c705a800 00007856 34128805 9e000000 88059900 00008905 92000000 89058d00 00008905 88000000 89058300 00008905 7e000000 c6050300 000012c6 05040000 0012c705 00000000 78563412 c7050100 00007856 3412c705 02000000 78563412 c7050300 00007856 3412c705 04000000 78563412 88050400 00008805 05000000 89050400 00008905 05000000 89050600 00008905 07000000 89050800 0000') // CHECK: # Section 1 // CHECK: (('section_name', '__data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') // CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') @@ -294,7 +294,7 @@ L1: // CHECK: ), // CHECK: ('_relocations', [ // CHECK: ]) -// CHECK: ('_section_data', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('_section_data', '00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000') // CHECK: ]) // CHECK: ), // CHECK: # Load Command 1 diff --git a/test/MC/MachO/darwin-x86_64-reloc.s b/test/MC/MachO/darwin-x86_64-reloc.s index 19b4345..83c0de7 100644 --- a/test/MC/MachO/darwin-x86_64-reloc.s +++ b/test/MC/MachO/darwin-x86_64-reloc.s @@ -90,7 +90,7 @@ L6: // CHECK: ('cputype', 16777223) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 496) // CHECK: ('flag', 0) // CHECK: ('reserved', 0) @@ -139,7 +139,7 @@ L6: // CHECK: (('word-0', 0x4), // CHECK: ('word-1', 0x4d000008)), // CHECK: ]) -// CHECK: ('_section_data', '\x00\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x1f\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00/\x01\x00\x00\x00\x00\x00\x00') +// CHECK: ('_section_data', '00000000 04000000 04000000 00000000 1f010000 00000000 00000000 00000000 2f010000 00000000') // CHECK: # Section 1 // CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') // CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') @@ -252,7 +252,7 @@ L6: // CHECK: (('word-0', 0x2), // CHECK: ('word-1', 0x2d000000)), // CHECK: ]) -// CHECK: ('_section_data', '\xc3\xe8\x00\x00\x00\x00\xe8\x04\x00\x00\x00H\x8b\x05\x00\x00\x00\x00\xff5\x00\x00\x00\x00\x8b\x05\x00\x00\x00\x00\x8b\x05\x04\x00\x00\x00\xc6\x05\xff\xff\xff\xff\x12\xc7\x05\xfc\xff\xff\xffxV4\x12\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00H\x8d\x05,\x00\x00\x00H\x8d\x05\x14\x00\x00\x00\x83\x05\x13\x00\x00\x00\x06f\x81\x05\x12\x00\x00\x00\xf4\x01\x81\x05\x10\x00\x00\x00\xf4\x01\x00\x00\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90,\x00\x00\x00\x00\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\xe4\xff\xff\xff\xff\xff\xff\xff\xd4\xff\xff\xff\xff\xff\xff\xff,\x00\x00\x00\x00\x00\x00\x00\x83\xc0\x00\x03\x04%\x03\x00\x00\x00\x8b\x05\x1f\xff\xff\xff\x8b\x05,\x00\x00\x00\x8b\x05\x00\x00\x00\x00\x8b\x050\x00\x00\x00H\x83=\xff\xff\xff\xff\x00') +// CHECK: ('_section_data', 'c3e80000 0000e804 00000048 8b050000 0000ff35 00000000 8b050000 00008b05 04000000 c605ffff ffff12c7 05fcffff ff785634 12000000 00000000 00040000 00000000 00000000 00000000 00040000 00000000 00000000 00488d05 2c000000 488d0514 00000083 05130000 00066681 05120000 00f40181 05100000 00f40100 00909090 90909090 90909090 902c0000 00000000 00140000 00000000 00e4ffff ffffffff ffd4ffff ffffffff ff2c0000 00000000 0083c000 03042503 0000008b 051fffff ff8b052c 0000008b 05000000 008b0530 00000048 833dffff ffff00') // CHECK: # Section 2 // CHECK: (('section_name', '__debug_frame\x00\x00\x00') // CHECK: ('segment_name', '__DWARF\x00\x00\x00\x00\x00\x00\x00\x00\x00') @@ -275,7 +275,7 @@ L6: // CHECK: (('word-0', 0x0), // CHECK: ('word-1', 0x6000002)), // CHECK: ]) -// CHECK: ('_section_data', '\xd5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('_section_data', 'd5000000 00000000 00000000 00000000') // CHECK: # Section 3 // CHECK: (('section_name', '__literal8\x00\x00\x00\x00\x00\x00') // CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') @@ -292,7 +292,7 @@ L6: // CHECK: ), // CHECK: ('_relocations', [ // CHECK: ]) -// CHECK: ('_section_data', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('_section_data', '00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000') // CHECK: ]) // CHECK: ), // CHECK: # Load Command 1 diff --git a/test/MC/MachO/diff-with-two-sections.s b/test/MC/MachO/diff-with-two-sections.s new file mode 100644 index 0000000..b5e0988 --- /dev/null +++ b/test/MC/MachO/diff-with-two-sections.s @@ -0,0 +1,64 @@ +// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s + + .section __TEXT,__text,regular,pure_instructions +Leh_func_begin0: + .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support +Ltmp3: +Ltmp4 = Leh_func_begin0-Ltmp3 + .long Ltmp4 + +// CHECK: ('cputype', 7) +// CHECK-NEXT: ('cpusubtype', 3) +// CHECK-NEXT: ('filetype', 1) +// CHECK-NEXT: ('num_load_commands', 1) +// CHECK-NEXT: ('load_commands_size', 192) +// CHECK-NEXT: ('flag', 0) +// CHECK-NEXT: ('load_commands', [ +// CHECK-NEXT: # Load Command 0 +// CHECK-NEXT: (('command', 1) +// CHECK-NEXT: ('size', 192) +// CHECK-NEXT: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('vm_addr', 0) +// CHECK-NEXT: ('vm_size', 4) +// CHECK-NEXT: ('file_offset', 220) +// CHECK-NEXT: ('file_size', 4) +// CHECK-NEXT: ('maxprot', 7) +// CHECK-NEXT: ('initprot', 7) +// CHECK-NEXT: ('num_sections', 2) +// CHECK-NEXT: ('flags', 0) +// CHECK-NEXT: ('sections', [ +// CHECK-NEXT: # Section 0 +// CHECK-NEXT: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('address', 0) +// CHECK-NEXT: ('size', 0) +// CHECK-NEXT: ('offset', 220) +// CHECK-NEXT: ('alignment', 0) +// CHECK-NEXT: ('reloc_offset', 0) +// CHECK-NEXT: ('num_reloc', 0) +// CHECK-NEXT: ('flags', 0x80000000) +// CHECK-NEXT: ('reserved1', 0) +// CHECK-NEXT: ('reserved2', 0) +// CHECK-NEXT: ), +// CHECK-NEXT: ('_relocations', [ +// CHECK-NEXT: ]) +// CHECK-NEXT: ('_section_data', '') +// CHECK-NEXT: # Section 1 +// CHECK-NEXT: (('section_name', '__eh_frame\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('address', 0) +// CHECK-NEXT: ('size', 4) +// CHECK-NEXT: ('offset', 220) +// CHECK-NEXT: ('alignment', 0) +// CHECK-NEXT: ('reloc_offset', 0) +// CHECK-NEXT: ('num_reloc', 0) +// CHECK-NEXT: ('flags', 0x6800000b) +// CHECK-NEXT: ('reserved1', 0) +// CHECK-NEXT: ('reserved2', 0) +// CHECK-NEXT: ), +// CHECK-NEXT: ('_relocations', [ +// CHECK-NEXT: ]) +// CHECK-NEXT: ('_section_data', '00000000') +// CHECK-NEXT: ]) +// CHECK-NEXT: ), +// CHECK-NEXT: ]) diff --git a/test/MC/MachO/direction_labels.s b/test/MC/MachO/direction_labels.s index 5a68f7f..e224ed3 100644 --- a/test/MC/MachO/direction_labels.s +++ b/test/MC/MachO/direction_labels.s @@ -14,7 +14,7 @@ direction_labels: // CHECK: ('cputype', 7) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 228) // CHECK: ('flag', 0) // CHECK: ('load_commands', [ @@ -46,7 +46,7 @@ direction_labels: // CHECK: ), // CHECK: ('_relocations', [ // CHECK: ]) -// CHECK: ('_section_data', '\x90\xeb\xfd\x90u\x00\x90u\xfd\xeb\x00\x90\xc3') +// CHECK: ('_section_data', '90ebfd90 75009075 fdeb0090 c3') // CHECK: ]) // CHECK: ), // CHECK: # Load Command 1 diff --git a/test/MC/MachO/empty-dwarf-lines.s b/test/MC/MachO/empty-dwarf-lines.s new file mode 100644 index 0000000..4bdc16b --- /dev/null +++ b/test/MC/MachO/empty-dwarf-lines.s @@ -0,0 +1,25 @@ +// RUN: llvm-mc -triple x86_64-apple-darwin9 %s -filetype=obj -o - | macho-dump | FileCheck %s + +// This tests that when producing files for darwin9 or older we make sure +// that debug_line sections are of a minimum size to avoid the linker bug +// described in PR8715. + + .section __DATA,__data + .file 1 "test.c" + .globl _c ## @c +_c: + .asciz "hi\n" + +// CHECK: (('section_name', '__debug_line\x00\x00\x00\x00') +// CHECK-NEXT: ('segment_name', '__DWARF\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('address', 4) +// CHECK-NEXT: ('size', 44) +// CHECK-NEXT: ('offset', 452) +// CHECK-NEXT: ('alignment', 0) +// CHECK-NEXT: ('reloc_offset', 0) +// CHECK-NEXT: ('num_reloc', 0) +// CHECK-NEXT: ('flags', 0x2000000) +// CHECK-NEXT: ('reserved1', 0) +// CHECK-NEXT: ('reserved2', 0) +// CHECK-NEXT: ('reserved3', 0) +// CHECK-NEXT: ), diff --git a/test/MC/MachO/indirect-symbols.s b/test/MC/MachO/indirect-symbols.s index 45a62f6..90fd231 100644 --- a/test/MC/MachO/indirect-symbols.s +++ b/test/MC/MachO/indirect-symbols.s @@ -23,7 +23,7 @@ _e: // CHECK: ('cputype', 7) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 364) // CHECK: ('flag', 0) // CHECK: ('load_commands', [ @@ -71,7 +71,7 @@ _e: // CHECK: ), // CHECK: ('_relocations', [ // CHECK: ]) -// CHECK: ('_section_data', '\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4') +// CHECK: ('_section_data', 'f4f4f4f4 f4f4f4f4 f4f4f4f4 f4f4f4') // CHECK: # Section 2 // CHECK: (('section_name', '__pointers\x00\x00\x00\x00\x00\x00') // CHECK: ('segment_name', '__IMPORT\x00\x00\x00\x00\x00\x00\x00\x00') @@ -87,7 +87,7 @@ _e: // CHECK: ), // CHECK: ('_relocations', [ // CHECK: ]) -// CHECK: ('_section_data', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('_section_data', '00000000 00000000 00000000') // CHECK: ]) // CHECK: ), // CHECK: # Load Command 1 diff --git a/test/MC/MachO/jcc.s b/test/MC/MachO/jcc.s index 7640429..2288a20 100644 --- a/test/MC/MachO/jcc.s +++ b/test/MC/MachO/jcc.s @@ -10,7 +10,7 @@ 1: nop jc 1f 1: nop - jcxz 1f + jecxz 1f 1: nop jecxz 1f 1: nop @@ -100,7 +100,7 @@ // CHECK: ), // CHECK: ('_relocations', [ // CHECK: ]) -// CHECK: ('_section_data', 'w\x00\x90s\x00\x90r\x00\x90v\x00\x90r\x00\x90\xe3\x00\x90\xe3\x00\x90t\x00\x90\x7f\x00\x90}\x00\x90|\x00\x90~\x00\x90v\x00\x90r\x00\x90s\x00\x90w\x00\x90s\x00\x90u\x00\x90~\x00\x90|\x00\x90}\x00\x90\x7f\x00\x90q\x00\x90{\x00\x90y\x00\x90u\x00\x90p\x00\x90z\x00\x90z\x00\x90{\x00\x90x\x00\x90t\x00\x90') +// CHECK: ('_section_data', '77009073 00907200 90760090 720090e3 0090e300 90740090 7f00907d 00907c00 907e0090 76009072 00907300 90770090 73009075 00907e00 907c0090 7d00907f 00907100 907b0090 79009075 00907000 907a0090 7a00907b 00907800 90740090') // CHECK: ]) // CHECK: ), // CHECK: ]) diff --git a/test/MC/MachO/lcomm-attributes.s b/test/MC/MachO/lcomm-attributes.s index 2685395..1e95924 100644 --- a/test/MC/MachO/lcomm-attributes.s +++ b/test/MC/MachO/lcomm-attributes.s @@ -17,7 +17,7 @@ // CHECK: ('cputype', 7) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 296) // CHECK: ('flag', 0) // CHECK: ('load_commands', [ diff --git a/test/MC/MachO/loc.s b/test/MC/MachO/loc.s new file mode 100644 index 0000000..6e7faa3 --- /dev/null +++ b/test/MC/MachO/loc.s @@ -0,0 +1,25 @@ +// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s + + .file 1 "foo" + .loc 1 64 0 + nop + +// CHECK: # Section 1 +// CHECK-NEXT: (('section_name', '__debug_line\x00\x00\x00\x00') +// CHECK-NEXT: ('segment_name', '__DWARF\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('address', 1) +// CHECK-NEXT: ('size', 51) +// CHECK-NEXT: ('offset', 221) +// CHECK-NEXT: ('alignment', 0) +// CHECK-NEXT: ('reloc_offset', 272) +// CHECK-NEXT: ('num_reloc', 1) +// CHECK-NEXT: ('flags', 0x2000000) +// CHECK-NEXT: ('reserved1', 0) +// CHECK-NEXT: ('reserved2', 0) +// CHECK-NEXT: ), +// CHECK-NEXT: ('_relocations', [ +// CHECK-NEXT: # Relocation 0 +// CHECK-NEXT: (('word-0', 0x27), +// CHECK-NEXT: ('word-1', 0x4000001)), +// CHECK-NEXT: ]) +// CHECK-NEXT: ('_section_data', '2f000000 02001a00 00000101 fb0e0d00 01010101 00000001 00000100 666f6f00 00000000 00050200 00000003 3f010201 000101') diff --git a/test/MC/MachO/pcrel-to-other-section.s b/test/MC/MachO/pcrel-to-other-section.s new file mode 100644 index 0000000..22a7822 --- /dev/null +++ b/test/MC/MachO/pcrel-to-other-section.s @@ -0,0 +1,107 @@ +// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s + +nop + .section __TEXT,__StaticInit,regular,pure_instructions + calll foo + +// CHECK: ('cputype', 7) +// CHECK-NEXT: ('cpusubtype', 3) +// CHECK-NEXT: ('filetype', 1) +// CHECK-NEXT: ('num_load_commands', 3) +// CHECK-NEXT: ('load_commands_size', 296) +// CHECK-NEXT: ('flag', 0) +// CHECK-NEXT: ('load_commands', [ +// CHECK-NEXT: # Load Command 0 +// CHECK-NEXT: (('command', 1) +// CHECK-NEXT: ('size', 192) +// CHECK-NEXT: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('vm_addr', 0) +// CHECK-NEXT: ('vm_size', 6) +// CHECK-NEXT: ('file_offset', 324) +// CHECK-NEXT: ('file_size', 6) +// CHECK-NEXT: ('maxprot', 7) +// CHECK-NEXT: ('initprot', 7) +// CHECK-NEXT: ('num_sections', 2) +// CHECK-NEXT: ('flags', 0) +// CHECK-NEXT: ('sections', [ +// CHECK-NEXT: # Section 0 +// CHECK-NEXT: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('address', 0) +// CHECK-NEXT: ('size', 1) +// CHECK-NEXT: ('offset', 324) +// CHECK-NEXT: ('alignment', 0) +// CHECK-NEXT: ('reloc_offset', 0) +// CHECK-NEXT: ('num_reloc', 0) +// CHECK-NEXT: ('flags', 0x80000400) +// CHECK-NEXT: ('reserved1', 0) +// CHECK-NEXT: ('reserved2', 0) +// CHECK-NEXT: ), +// CHECK-NEXT: ('_relocations', [ +// CHECK-NEXT: ]) +// CHECK-NEXT: ('_section_data', '90') +// CHECK-NEXT: # Section 1 +// CHECK-NEXT: (('section_name', '__StaticInit\x00\x00\x00\x00') +// CHECK-NEXT: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('address', 1) +// CHECK-NEXT: ('size', 5) +// CHECK-NEXT: ('offset', 325) +// CHECK-NEXT: ('alignment', 0) +// CHECK-NEXT: ('reloc_offset', 332) +// CHECK-NEXT: ('num_reloc', 1) +// CHECK-NEXT: ('flags', 0x80000400) +// CHECK-NEXT: ('reserved1', 0) +// CHECK-NEXT: ('reserved2', 0) +// CHECK-NEXT: ), +// CHECK-NEXT: ('_relocations', [ +// CHECK-NEXT: # Relocation 0 +// CHECK-NEXT: (('word-0', 0x1), +// CHECK-NEXT: ('word-1', 0xd000000)), +// CHECK-NEXT: ]) +// CHECK-NEXT: ('_section_data', 'e8faffff ff') +// CHECK-NEXT: ]) +// CHECK-NEXT: ), +// CHECK-NEXT: # Load Command 1 +// CHECK-NEXT: (('command', 2) +// CHECK-NEXT: ('size', 24) +// CHECK-NEXT: ('symoff', 340) +// CHECK-NEXT: ('nsyms', 1) +// CHECK-NEXT: ('stroff', 352) +// CHECK-NEXT: ('strsize', 8) +// CHECK-NEXT: ('_string_data', '\x00foo\x00\x00\x00\x00') +// CHECK-NEXT: ('_symbols', [ +// CHECK-NEXT: # Symbol 0 +// CHECK-NEXT: (('n_strx', 1) +// CHECK-NEXT: ('n_type', 0x1) +// CHECK-NEXT: ('n_sect', 0) +// CHECK-NEXT: ('n_desc', 0) +// CHECK-NEXT: ('n_value', 0) +// CHECK-NEXT: ('_string', 'foo') +// CHECK-NEXT: ), +// CHECK-NEXT: ]) +// CHECK-NEXT: ), +// CHECK-NEXT: # Load Command 2 +// CHECK-NEXT: (('command', 11) +// CHECK-NEXT: ('size', 80) +// CHECK-NEXT: ('ilocalsym', 0) +// CHECK-NEXT: ('nlocalsym', 0) +// CHECK-NEXT: ('iextdefsym', 0) +// CHECK-NEXT: ('nextdefsym', 0) +// CHECK-NEXT: ('iundefsym', 0) +// CHECK-NEXT: ('nundefsym', 1) +// CHECK-NEXT: ('tocoff', 0) +// CHECK-NEXT: ('ntoc', 0) +// CHECK-NEXT: ('modtaboff', 0) +// CHECK-NEXT: ('nmodtab', 0) +// CHECK-NEXT: ('extrefsymoff', 0) +// CHECK-NEXT: ('nextrefsyms', 0) +// CHECK-NEXT: ('indirectsymoff', 0) +// CHECK-NEXT: ('nindirectsyms', 0) +// CHECK-NEXT: ('extreloff', 0) +// CHECK-NEXT: ('nextrel', 0) +// CHECK-NEXT: ('locreloff', 0) +// CHECK-NEXT: ('nlocrel', 0) +// CHECK-NEXT: ('_indirect_symbols', [ +// CHECK-NEXT: ]) +// CHECK-NEXT: ), +// CHECK-NEXT: ]) diff --git a/test/MC/MachO/relax-jumps.s b/test/MC/MachO/relax-jumps.s index 9c58aa7..65a51e9 100644 --- a/test/MC/MachO/relax-jumps.s +++ b/test/MC/MachO/relax-jumps.s @@ -10,9 +10,9 @@ // diff $f.{as,mc}.dump) // to examine the results in a more sensible fashion. -// CHECK: ('_section_data', '\x90 -// CHECK: \x0f\x842\xff\xff\xff\x0f\x82\xe6\x00\x00\x00\x0f\x87&\xff\xff\xff\x0f\x8f\xda\x00\x00\x00\x0f\x88\x1a\xff\xff\xff\x0f\x83\xce\x00\x00\x00\x0f\x89\x0e\xff\xff\xff\x90 -// CHECK: \x901\xc0') +// CHECK: ('_section_data', '90 +// CHECK: 0f8432ff ffff0f82 e6000000 0f8726ff ffff0f8f da000000 0f881aff ffff0f83 ce000000 0f890eff ffff90 +// CHECK: 9031c0') L1: .space 200, 0x90 diff --git a/test/MC/MachO/reloc-pcrel-offset.s b/test/MC/MachO/reloc-pcrel-offset.s index 46dc3a9..e0f12bf 100644 --- a/test/MC/MachO/reloc-pcrel-offset.s +++ b/test/MC/MachO/reloc-pcrel-offset.s @@ -4,7 +4,7 @@ // CHECK: (('word-0', 0x1), // CHECK: ('word-1', 0x5000002)), // CHECK-NEXT: ]) -// CHECK: ('_section_data', '\xe8\xfb\xff\xff\xff') +// CHECK: ('_section_data', 'e8fbffff ff') .data .long 0 diff --git a/test/MC/MachO/reloc.s b/test/MC/MachO/reloc.s index f91f425..f6a3446 100644 --- a/test/MC/MachO/reloc.s +++ b/test/MC/MachO/reloc.s @@ -37,6 +37,7 @@ L0: .text _f0: L1: + jmp 0xbabecafe jmp L0 jmp L1 ret @@ -55,7 +56,7 @@ _f1: // CHECK: ('cputype', 7) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 364) // CHECK: ('flag', 0) // CHECK: ('load_commands', [ @@ -64,9 +65,9 @@ _f1: // CHECK: ('size', 260) // CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') // CHECK: ('vm_addr', 0) -// CHECK: ('vm_size', 71) +// CHECK: ('vm_size', 76) // CHECK: ('file_offset', 392) -// CHECK: ('file_size', 71) +// CHECK: ('file_size', 76) // CHECK: ('maxprot', 7) // CHECK: ('initprot', 7) // CHECK: ('num_sections', 3) @@ -76,29 +77,32 @@ _f1: // CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') // CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') // CHECK: ('address', 0) -// CHECK: ('size', 8) +// CHECK: ('size', 13) // CHECK: ('offset', 392) // CHECK: ('alignment', 0) -// CHECK: ('reloc_offset', 464) -// CHECK: ('num_reloc', 1) +// CHECK: ('reloc_offset', 468) +// CHECK: ('num_reloc', 2) // CHECK: ('flags', 0x80000400) // CHECK: ('reserved1', 0) // CHECK: ('reserved2', 0) // CHECK: ), // CHECK: ('_relocations', [ // CHECK: # Relocation 0 -// CHECK: (('word-0', 0x1), +// CHECK: (('word-0', 0x6), // CHECK: ('word-1', 0x5000003)), +// CHECK: # Relocation 1 +// CHECK: (('word-0', 0x1), +// CHECK: ('word-1', 0x5000000)), // CHECK: ]) -// CHECK: ('_section_data', '\xe9:\x00\x00\x00\xeb\xf9\xc3') +// CHECK: ('_section_data', 'e9f9cabe bae93a00 0000ebf4 c3') // CHECK: # Section 1 // CHECK: (('section_name', '__data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') // CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') -// CHECK: ('address', 8) +// CHECK: ('address', 13) // CHECK: ('size', 51) -// CHECK: ('offset', 400) +// CHECK: ('offset', 405) // CHECK: ('alignment', 0) -// CHECK: ('reloc_offset', 472) +// CHECK: ('reloc_offset', 484) // CHECK: ('num_reloc', 11) // CHECK: ('flags', 0x0) // CHECK: ('reserved1', 0) @@ -113,22 +117,22 @@ _f1: // CHECK: ('word-1', 0xc000007)), // CHECK: # Relocation 2 // CHECK: (('word-0', 0x8000002a), -// CHECK: ('word-1', 0x18)), +// CHECK: ('word-1', 0x1d)), // CHECK: # Relocation 3 // CHECK: (('word-0', 0x90000028), -// CHECK: ('word-1', 0x18)), +// CHECK: ('word-1', 0x1d)), // CHECK: # Relocation 4 // CHECK: (('word-0', 0xa0000024), -// CHECK: ('word-1', 0x18)), +// CHECK: ('word-1', 0x1d)), // CHECK: # Relocation 5 // CHECK: (('word-0', 0xa0000020), -// CHECK: ('word-1', 0x18)), +// CHECK: ('word-1', 0x1d)), // CHECK: # Relocation 6 // CHECK: (('word-0', 0xa4000014), -// CHECK: ('word-1', 0x1c)), +// CHECK: ('word-1', 0x21)), // CHECK: # Relocation 7 // CHECK: (('word-0', 0xa1000000), -// CHECK: ('word-1', 0x24)), +// CHECK: ('word-1', 0x29)), // CHECK: # Relocation 8 // CHECK: (('word-0', 0x8), // CHECK: ('word-1', 0x4000002)), @@ -139,15 +143,15 @@ _f1: // CHECK: (('word-0', 0x0), // CHECK: ('word-1', 0xc000009)), // CHECK: ]) -// CHECK: ('_section_data', '\x00\x00\x00\x00\x04\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xed\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19\x00\x00\x00"\x00\x00\x00,\x00q\x00\x00\x00\x00\x04\x00\x00\x00') +// CHECK: ('_section_data', '00000000 04000000 15000000 00000000 00000000 ed000000 00000000 00000000 1e000000 27000000 31007600 00000004 000000') // CHECK: # Section 2 // CHECK: (('section_name', '__const\x00\x00\x00\x00\x00\x00\x00\x00\x00') // CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') -// CHECK: ('address', 59) +// CHECK: ('address', 64) // CHECK: ('size', 12) -// CHECK: ('offset', 451) +// CHECK: ('offset', 456) // CHECK: ('alignment', 0) -// CHECK: ('reloc_offset', 560) +// CHECK: ('reloc_offset', 572) // CHECK: ('num_reloc', 4) // CHECK: ('flags', 0x0) // CHECK: ('reserved1', 0) @@ -162,20 +166,20 @@ _f1: // CHECK: ('word-1', 0x4000003)), // CHECK: # Relocation 2 // CHECK: (('word-0', 0xa4000000), -// CHECK: ('word-1', 0x18)), +// CHECK: ('word-1', 0x1d)), // CHECK: # Relocation 3 // CHECK: (('word-0', 0xa1000000), -// CHECK: ('word-1', 0x3b)), +// CHECK: ('word-1', 0x40)), // CHECK: ]) -// CHECK: ('_section_data', '\xfe\xff\xff\xff?\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('_section_data', 'feffffff 44000000 00000000') // CHECK: ]) // CHECK: ), // CHECK: # Load Command 1 // CHECK: (('command', 2) // CHECK: ('size', 24) -// CHECK: ('symoff', 592) +// CHECK: ('symoff', 604) // CHECK: ('nsyms', 10) -// CHECK: ('stroff', 712) +// CHECK: ('stroff', 724) // CHECK: ('strsize', 88) // CHECK: ('_string_data', '\x00undef\x00local_a_ext\x00.objc_class_name_A\x00_f1\x00local_a\x00local_a_elt\x00local_b\x00local_c\x00bar\x00_f0\x00\x00\x00') // CHECK: ('_symbols', [ @@ -184,7 +188,7 @@ _f1: // CHECK: ('n_type', 0xe) // CHECK: ('n_sect', 2) // CHECK: ('n_desc', 0) -// CHECK: ('n_value', 20) +// CHECK: ('n_value', 25) // CHECK: ('_string', 'local_a') // CHECK: ), // CHECK: # Symbol 1 @@ -192,7 +196,7 @@ _f1: // CHECK: ('n_type', 0xe) // CHECK: ('n_sect', 2) // CHECK: ('n_desc', 0) -// CHECK: ('n_value', 24) +// CHECK: ('n_value', 29) // CHECK: ('_string', 'local_a_elt') // CHECK: ), // CHECK: # Symbol 2 @@ -200,7 +204,7 @@ _f1: // CHECK: ('n_type', 0xe) // CHECK: ('n_sect', 2) // CHECK: ('n_desc', 0) -// CHECK: ('n_value', 28) +// CHECK: ('n_value', 33) // CHECK: ('_string', 'local_b') // CHECK: ), // CHECK: # Symbol 3 @@ -208,7 +212,7 @@ _f1: // CHECK: ('n_type', 0xe) // CHECK: ('n_sect', 2) // CHECK: ('n_desc', 0) -// CHECK: ('n_value', 36) +// CHECK: ('n_value', 41) // CHECK: ('_string', 'local_c') // CHECK: ), // CHECK: # Symbol 4 @@ -216,7 +220,7 @@ _f1: // CHECK: ('n_type', 0xe) // CHECK: ('n_sect', 3) // CHECK: ('n_desc', 0) -// CHECK: ('n_value', 59) +// CHECK: ('n_value', 64) // CHECK: ('_string', 'bar') // CHECK: ), // CHECK: # Symbol 5 @@ -240,7 +244,7 @@ _f1: // CHECK: ('n_type', 0xf) // CHECK: ('n_sect', 1) // CHECK: ('n_desc', 128) -// CHECK: ('n_value', 8) +// CHECK: ('n_value', 13) // CHECK: ('_string', '_f1') // CHECK: ), // CHECK: # Symbol 8 @@ -248,7 +252,7 @@ _f1: // CHECK: ('n_type', 0xf) // CHECK: ('n_sect', 2) // CHECK: ('n_desc', 0) -// CHECK: ('n_value', 16) +// CHECK: ('n_value', 21) // CHECK: ('_string', 'local_a_ext') // CHECK: ), // CHECK: # Symbol 9 diff --git a/test/MC/MachO/section-align-1.s b/test/MC/MachO/section-align-1.s index 6a5e247..360c0a8 100644 --- a/test/MC/MachO/section-align-1.s +++ b/test/MC/MachO/section-align-1.s @@ -9,7 +9,7 @@ name: // CHECK: ('cputype', 7) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 228) // CHECK: ('flag', 0) // CHECK: ('load_commands', [ diff --git a/test/MC/MachO/section-align-2.s b/test/MC/MachO/section-align-2.s index e070473..e0d7b8d 100644 --- a/test/MC/MachO/section-align-2.s +++ b/test/MC/MachO/section-align-2.s @@ -17,7 +17,7 @@ baz: // CHECK: ('cputype', 7) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 364) // CHECK: ('flag', 0) // CHECK: ('load_commands', [ diff --git a/test/MC/MachO/string-table.s b/test/MC/MachO/string-table.s index b811a0b..179528e 100644 --- a/test/MC/MachO/string-table.s +++ b/test/MC/MachO/string-table.s @@ -5,7 +5,7 @@ // CHECK: ('cputype', 7) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 228) // CHECK: ('flag', 0) // CHECK: ('load_commands', [ @@ -43,7 +43,7 @@ // CHECK: (('word-0', 0x2), // CHECK: ('word-1', 0xc000001)), // CHECK: ]) -// CHECK: ('_section_data', '\xc7\x05\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('_section_data', 'c7050000 00000000 0000') // CHECK: ]) // CHECK: ), // CHECK: # Load Command 1 diff --git a/test/MC/MachO/symbol-diff.s b/test/MC/MachO/symbol-diff.s new file mode 100644 index 0000000..1483df1 --- /dev/null +++ b/test/MC/MachO/symbol-diff.s @@ -0,0 +1,122 @@ +// RUN: llvm-mc -triple x86_64-apple-darwin10 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s +_g: +LFB2: + .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support +_g.eh: + .quad LFB2-. + +// CHECK: ('cputype', 16777223) +// CHECK-NEXT: ('cpusubtype', 3) +// CHECK-NEXT: ('filetype', 1) +// CHECK-NEXT: ('num_load_commands', 3) +// CHECK-NEXT: ('load_commands_size', 336) +// CHECK-NEXT: ('flag', 0) +// CHECK-NEXT: ('reserved', 0) +// CHECK-NEXT: ('load_commands', [ +// CHECK-NEXT: # Load Command 0 +// CHECK-NEXT: (('command', 25) +// CHECK-NEXT: ('size', 232) +// CHECK-NEXT: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('vm_addr', 0) +// CHECK-NEXT: ('vm_size', 8) +// CHECK-NEXT: ('file_offset', 368) +// CHECK-NEXT: ('file_size', 8) +// CHECK-NEXT: ('maxprot', 7) +// CHECK-NEXT: ('initprot', 7) +// CHECK-NEXT: ('num_sections', 2) +// CHECK-NEXT: ('flags', 0) +// CHECK-NEXT: ('sections', [ +// CHECK-NEXT: # Section 0 +// CHECK-NEXT: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('address', 0) +// CHECK-NEXT: ('size', 0) +// CHECK-NEXT: ('offset', 368) +// CHECK-NEXT: ('alignment', 0) +// CHECK-NEXT: ('reloc_offset', 0) +// CHECK-NEXT: ('num_reloc', 0) +// CHECK-NEXT: ('flags', 0x80000000) +// CHECK-NEXT: ('reserved1', 0) +// CHECK-NEXT: ('reserved2', 0) +// CHECK-NEXT: ('reserved3', 0) +// CHECK-NEXT: ), +// CHECK-NEXT: ('_relocations', [ +// CHECK-NEXT: ]) +// CHECK-NEXT: ('_section_data', '') +// CHECK-NEXT: # Section 1 +// CHECK-NEXT: (('section_name', '__eh_frame\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('address', 0) +// CHECK-NEXT: ('size', 8) +// CHECK-NEXT: ('offset', 368) +// CHECK-NEXT: ('alignment', 0) +// CHECK-NEXT: ('reloc_offset', 376) +// CHECK-NEXT: ('num_reloc', 2) +// CHECK-NEXT: ('flags', 0x6800000b) +// CHECK-NEXT: ('reserved1', 0) +// CHECK-NEXT: ('reserved2', 0) +// CHECK-NEXT: ('reserved3', 0) +// CHECK-NEXT: ), +// CHECK-NEXT: ('_relocations', [ +// CHECK-NEXT: # Relocation 0 +// CHECK-NEXT: (('word-0', 0x0), +// CHECK-NEXT: ('word-1', 0x5e000001)), +// CHECK-NEXT: # Relocation 1 +// CHECK-NEXT: (('word-0', 0x0), +// CHECK-NEXT: ('word-1', 0xe000000)), +// CHECK-NEXT: ]) +// CHECK-NEXT: ('_section_data', '00000000 00000000') +// CHECK-NEXT: ]) +// CHECK-NEXT: ), +// CHECK-NEXT: # Load Command 1 +// CHECK-NEXT: (('command', 2) +// CHECK-NEXT: ('size', 24) +// CHECK-NEXT: ('symoff', 392) +// CHECK-NEXT: ('nsyms', 2) +// CHECK-NEXT: ('stroff', 424) +// CHECK-NEXT: ('strsize', 12) +// CHECK-NEXT: ('_string_data', '\x00_g\x00_g.eh\x00\x00\x00') +// CHECK-NEXT: ('_symbols', [ +// CHECK-NEXT: # Symbol 0 +// CHECK-NEXT: (('n_strx', 1) +// CHECK-NEXT: ('n_type', 0xe) +// CHECK-NEXT: ('n_sect', 1) +// CHECK-NEXT: ('n_desc', 0) +// CHECK-NEXT: ('n_value', 0) +// CHECK-NEXT: ('_string', '_g') +// CHECK-NEXT: ), +// CHECK-NEXT: # Symbol 1 +// CHECK-NEXT: (('n_strx', 4) +// CHECK-NEXT: ('n_type', 0xe) +// CHECK-NEXT: ('n_sect', 2) +// CHECK-NEXT: ('n_desc', 0) +// CHECK-NEXT: ('n_value', 0) +// CHECK-NEXT: ('_string', '_g.eh') +// CHECK-NEXT: ), +// CHECK-NEXT: ]) +// CHECK-NEXT: ), +// CHECK-NEXT: # Load Command 2 +// CHECK-NEXT: (('command', 11) +// CHECK-NEXT: ('size', 80) +// CHECK-NEXT: ('ilocalsym', 0) +// CHECK-NEXT: ('nlocalsym', 2) +// CHECK-NEXT: ('iextdefsym', 2) +// CHECK-NEXT: ('nextdefsym', 0) +// CHECK-NEXT: ('iundefsym', 2) +// CHECK-NEXT: ('nundefsym', 0) +// CHECK-NEXT: ('tocoff', 0) +// CHECK-NEXT: ('ntoc', 0) +// CHECK-NEXT: ('modtaboff', 0) +// CHECK-NEXT: ('nmodtab', 0) +// CHECK-NEXT: ('extrefsymoff', 0) +// CHECK-NEXT: ('nextrefsyms', 0) +// CHECK-NEXT: ('indirectsymoff', 0) +// CHECK-NEXT: ('nindirectsyms', 0) +// CHECK-NEXT: ('extreloff', 0) +// CHECK-NEXT: ('nextrel', 0) +// CHECK-NEXT: ('locreloff', 0) +// CHECK-NEXT: ('nlocrel', 0) +// CHECK-NEXT: ('_indirect_symbols', [ +// CHECK-NEXT: ]) +// CHECK-NEXT: ), +// CHECK-NEXT:]) diff --git a/test/MC/MachO/symbol-flags.s b/test/MC/MachO/symbol-flags.s index 705fa39..7a4f8e4 100644 --- a/test/MC/MachO/symbol-flags.s +++ b/test/MC/MachO/symbol-flags.s @@ -49,6 +49,9 @@ sym_private_ext_C: .no_dead_strip sym_no_dead_strip_A +sym_symbol_resolver_A: + .symbol_resolver sym_symbol_resolver_A + .reference sym_ref_A .desc sym_ref_A, 1 .desc sym_ref_A, 0x1234 @@ -59,7 +62,7 @@ sym_desc_flags: // CHECK: ('cputype', 7) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 296) // CHECK: ('flag', 0) // CHECK: ('load_commands', [ @@ -112,10 +115,10 @@ sym_desc_flags: // CHECK: (('command', 2) // CHECK: ('size', 24) // CHECK: ('symoff', 324) -// CHECK: ('nsyms', 23) -// CHECK: ('stroff', 600) -// CHECK: ('strsize', 368) -// CHECK: ('_string_data', '\x00sym_ref_A\x00sym_ref_def_D\x00sym_ref_def_E\x00sym_weak_ref_A\x00sym_weak_def_A\x00sym_weak_def_B\x00sym_weak_def_C\x00sym_lazy_ref_A\x00sym_lazy_ref_D\x00sym_lazy_ref_E\x00sym_private_ext_A\x00sym_private_ext_B\x00sym_private_ext_C\x00sym_private_ext_D\x00sym_private_ext_E\x00sym_no_dead_strip_A\x00sym_ref_def_A\x00sym_ref_def_C\x00sym_weak_ref_def_A\x00sym_weak_ref_def_B\x00sym_lazy_ref_B\x00sym_lazy_ref_C\x00sym_desc_flags\x00\x00\x00\x00') +// CHECK: ('nsyms', 24) +// CHECK: ('stroff', 612) +// CHECK: ('strsize', 388) +// CHECK: ('_string_data', '\x00sym_ref_A\x00sym_ref_def_D\x00sym_ref_def_E\x00sym_weak_ref_A\x00sym_weak_def_A\x00sym_weak_def_B\x00sym_weak_def_C\x00sym_lazy_ref_A\x00sym_lazy_ref_D\x00sym_lazy_ref_E\x00sym_private_ext_A\x00sym_private_ext_B\x00sym_private_ext_C\x00sym_private_ext_D\x00sym_private_ext_E\x00sym_no_dead_strip_A\x00sym_ref_def_A\x00sym_ref_def_C\x00sym_weak_ref_def_A\x00sym_weak_ref_def_B\x00sym_lazy_ref_B\x00sym_lazy_ref_C\x00sym_symbol_resolver_A\x00sym_desc_flags\x00\x00') // CHECK: ('_symbols', [ // CHECK: # Symbol 0 // CHECK: (('n_strx', 254) @@ -169,11 +172,19 @@ sym_desc_flags: // CHECK: (('n_strx', 350) // CHECK: ('n_type', 0xe) // CHECK: ('n_sect', 2) +// CHECK: ('n_desc', 256) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_symbol_resolver_A') +// CHECK: ), +// CHECK: # Symbol 7 +// CHECK: (('n_strx', 372) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 2) // CHECK: ('n_desc', 64) // CHECK: ('n_value', 0) // CHECK: ('_string', 'sym_desc_flags') // CHECK: ), -// CHECK: # Symbol 7 +// CHECK: # Symbol 8 // CHECK: (('n_strx', 162) // CHECK: ('n_type', 0x1f) // CHECK: ('n_sect', 2) @@ -181,7 +192,7 @@ sym_desc_flags: // CHECK: ('n_value', 0) // CHECK: ('_string', 'sym_private_ext_B') // CHECK: ), -// CHECK: # Symbol 8 +// CHECK: # Symbol 9 // CHECK: (('n_strx', 180) // CHECK: ('n_type', 0x1f) // CHECK: ('n_sect', 2) @@ -189,7 +200,7 @@ sym_desc_flags: // CHECK: ('n_value', 0) // CHECK: ('_string', 'sym_private_ext_C') // CHECK: ), -// CHECK: # Symbol 9 +// CHECK: # Symbol 10 // CHECK: (('n_strx', 54) // CHECK: ('n_type', 0xf) // CHECK: ('n_sect', 2) @@ -197,7 +208,7 @@ sym_desc_flags: // CHECK: ('n_value', 0) // CHECK: ('_string', 'sym_weak_def_A') // CHECK: ), -// CHECK: # Symbol 10 +// CHECK: # Symbol 11 // CHECK: (('n_strx', 69) // CHECK: ('n_type', 0xf) // CHECK: ('n_sect', 2) @@ -205,7 +216,7 @@ sym_desc_flags: // CHECK: ('n_value', 0) // CHECK: ('_string', 'sym_weak_def_B') // CHECK: ), -// CHECK: # Symbol 11 +// CHECK: # Symbol 12 // CHECK: (('n_strx', 84) // CHECK: ('n_type', 0xf) // CHECK: ('n_sect', 2) @@ -213,7 +224,7 @@ sym_desc_flags: // CHECK: ('n_value', 0) // CHECK: ('_string', 'sym_weak_def_C') // CHECK: ), -// CHECK: # Symbol 12 +// CHECK: # Symbol 13 // CHECK: (('n_strx', 99) // CHECK: ('n_type', 0x1) // CHECK: ('n_sect', 0) @@ -221,7 +232,7 @@ sym_desc_flags: // CHECK: ('n_value', 0) // CHECK: ('_string', 'sym_lazy_ref_A') // CHECK: ), -// CHECK: # Symbol 13 +// CHECK: # Symbol 14 // CHECK: (('n_strx', 114) // CHECK: ('n_type', 0x1) // CHECK: ('n_sect', 0) @@ -229,7 +240,7 @@ sym_desc_flags: // CHECK: ('n_value', 0) // CHECK: ('_string', 'sym_lazy_ref_D') // CHECK: ), -// CHECK: # Symbol 14 +// CHECK: # Symbol 15 // CHECK: (('n_strx', 129) // CHECK: ('n_type', 0x1) // CHECK: ('n_sect', 0) @@ -237,7 +248,7 @@ sym_desc_flags: // CHECK: ('n_value', 0) // CHECK: ('_string', 'sym_lazy_ref_E') // CHECK: ), -// CHECK: # Symbol 15 +// CHECK: # Symbol 16 // CHECK: (('n_strx', 234) // CHECK: ('n_type', 0x1) // CHECK: ('n_sect', 0) @@ -245,7 +256,7 @@ sym_desc_flags: // CHECK: ('n_value', 0) // CHECK: ('_string', 'sym_no_dead_strip_A') // CHECK: ), -// CHECK: # Symbol 16 +// CHECK: # Symbol 17 // CHECK: (('n_strx', 144) // CHECK: ('n_type', 0x11) // CHECK: ('n_sect', 0) @@ -253,7 +264,7 @@ sym_desc_flags: // CHECK: ('n_value', 0) // CHECK: ('_string', 'sym_private_ext_A') // CHECK: ), -// CHECK: # Symbol 17 +// CHECK: # Symbol 18 // CHECK: (('n_strx', 198) // CHECK: ('n_type', 0x11) // CHECK: ('n_sect', 0) @@ -261,7 +272,7 @@ sym_desc_flags: // CHECK: ('n_value', 0) // CHECK: ('_string', 'sym_private_ext_D') // CHECK: ), -// CHECK: # Symbol 18 +// CHECK: # Symbol 19 // CHECK: (('n_strx', 216) // CHECK: ('n_type', 0x11) // CHECK: ('n_sect', 0) @@ -269,7 +280,7 @@ sym_desc_flags: // CHECK: ('n_value', 0) // CHECK: ('_string', 'sym_private_ext_E') // CHECK: ), -// CHECK: # Symbol 19 +// CHECK: # Symbol 20 // CHECK: (('n_strx', 1) // CHECK: ('n_type', 0x1) // CHECK: ('n_sect', 0) @@ -277,7 +288,7 @@ sym_desc_flags: // CHECK: ('n_value', 0) // CHECK: ('_string', 'sym_ref_A') // CHECK: ), -// CHECK: # Symbol 20 +// CHECK: # Symbol 21 // CHECK: (('n_strx', 11) // CHECK: ('n_type', 0x1) // CHECK: ('n_sect', 0) @@ -285,7 +296,7 @@ sym_desc_flags: // CHECK: ('n_value', 0) // CHECK: ('_string', 'sym_ref_def_D') // CHECK: ), -// CHECK: # Symbol 21 +// CHECK: # Symbol 22 // CHECK: (('n_strx', 25) // CHECK: ('n_type', 0x1) // CHECK: ('n_sect', 0) @@ -293,7 +304,7 @@ sym_desc_flags: // CHECK: ('n_value', 0) // CHECK: ('_string', 'sym_ref_def_E') // CHECK: ), -// CHECK: # Symbol 22 +// CHECK: # Symbol 23 // CHECK: (('n_strx', 39) // CHECK: ('n_type', 0x1) // CHECK: ('n_sect', 0) @@ -307,10 +318,10 @@ sym_desc_flags: // CHECK: (('command', 11) // CHECK: ('size', 80) // CHECK: ('ilocalsym', 0) -// CHECK: ('nlocalsym', 7) -// CHECK: ('iextdefsym', 7) +// CHECK: ('nlocalsym', 8) +// CHECK: ('iextdefsym', 8) // CHECK: ('nextdefsym', 5) -// CHECK: ('iundefsym', 12) +// CHECK: ('iundefsym', 13) // CHECK: ('nundefsym', 11) // CHECK: ('tocoff', 0) // CHECK: ('ntoc', 0) diff --git a/test/MC/MachO/symbol-indirect.s b/test/MC/MachO/symbol-indirect.s index 461291a..2412970 100644 --- a/test/MC/MachO/symbol-indirect.s +++ b/test/MC/MachO/symbol-indirect.s @@ -72,7 +72,7 @@ sym_nlp_G: // CHECK: ('cputype', 7) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 364) // CHECK: ('flag', 0) // CHECK: ('load_commands', [ diff --git a/test/MC/MachO/symbols-1.s b/test/MC/MachO/symbols-1.s index 623e528..cf05afa 100644 --- a/test/MC/MachO/symbols-1.s +++ b/test/MC/MachO/symbols-1.s @@ -20,7 +20,7 @@ Lsym_asm_temp: // CHECK-X86_32: ('cputype', 7) // CHECK-X86_32: ('cpusubtype', 3) // CHECK-X86_32: ('filetype', 1) -// CHECK-X86_32: ('num_load_commands', 1) +// CHECK-X86_32: ('num_load_commands', 3) // CHECK-X86_32: ('load_commands_size', 228) // CHECK-X86_32: ('flag', 0) // CHECK-X86_32: ('load_commands', [ @@ -164,7 +164,7 @@ Lsym_asm_temp: // CHECK-X86_64: ('cputype', 16777223) // CHECK-X86_64: ('cpusubtype', 3) // CHECK-X86_64: ('filetype', 1) -// CHECK-X86_64: ('num_load_commands', 1) +// CHECK-X86_64: ('num_load_commands', 3) // CHECK-X86_64: ('load_commands_size', 256) // CHECK-X86_64: ('flag', 0) // CHECK-X86_64: ('reserved', 0) diff --git a/test/MC/MachO/tbss.s b/test/MC/MachO/tbss.s index 2131ea4..8eae142 100644 --- a/test/MC/MachO/tbss.s +++ b/test/MC/MachO/tbss.s @@ -6,7 +6,7 @@ // CHECK: ('cputype', 16777223) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 336) // CHECK: ('flag', 0) // CHECK: ('reserved', 0) @@ -57,7 +57,7 @@ // CHECK: ), // CHECK: ('_relocations', [ // CHECK: ]) -// CHECK: ('_section_data', '\xcf\xfa\xed\xfe\x07\x00\x00\x01\x03\x00\x00\x00') +// CHECK: ('_section_data', 'cffaedfe 07000001 03000000') // CHECK: ]) // CHECK: ), // CHECK: # Load Command 1 diff --git a/test/MC/MachO/tdata.s b/test/MC/MachO/tdata.s index 64f88b5..4829ca7 100644 --- a/test/MC/MachO/tdata.s +++ b/test/MC/MachO/tdata.s @@ -6,7 +6,7 @@ _a$tlv$init: // CHECK: ('cputype', 16777223) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 336) // CHECK: ('flag', 0) // CHECK: ('reserved', 0) @@ -57,7 +57,7 @@ _a$tlv$init: // CHECK: ), // CHECK: ('_relocations', [ // CHECK: ]) -// CHECK: ('_section_data', '\x04\x00\x00\x00') +// CHECK: ('_section_data', '04000000') // CHECK: ]) // CHECK: ), // CHECK: # Load Command 1 diff --git a/test/MC/MachO/thread_init_func.s b/test/MC/MachO/thread_init_func.s index eeab6e1..d3ead83 100644 --- a/test/MC/MachO/thread_init_func.s +++ b/test/MC/MachO/thread_init_func.s @@ -57,7 +57,7 @@ // CHECK: ), // CHECK: ('_relocations', [ // CHECK: ]) -// CHECK: ('_section_data', '\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('_section_data', '00000000 00000000') // CHECK: ]) // CHECK: ), // CHECK: ]) diff --git a/test/MC/MachO/tls.s b/test/MC/MachO/tls.s index 07ea0aa..44b61be 100644 --- a/test/MC/MachO/tls.s +++ b/test/MC/MachO/tls.s @@ -48,7 +48,7 @@ _b: // CHECK: ('cputype', 16777223) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 496) // CHECK: ('flag', 8192) // CHECK: ('reserved', 0) @@ -99,7 +99,7 @@ _b: // CHECK: ), // CHECK: ('_relocations', [ // CHECK: ]) -// CHECK: ('_section_data', '\x04\x00\x00\x00\x05\x00\x00\x00') +// CHECK: ('_section_data', '04000000 05000000') // CHECK: # Section 2 // CHECK: (('section_name', '__thread_vars\x00\x00\x00') // CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') @@ -140,7 +140,7 @@ _b: // CHECK: (('word-0', 0x0), // CHECK: ('word-1', 0xe000008)), // CHECK: ]) -// CHECK: ('_section_data', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('_section_data', '00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000') // CHECK: # Section 3 // CHECK: (('section_name', '__thread_bss\x00\x00\x00\x00') // CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') @@ -157,7 +157,7 @@ _b: // CHECK: ), // CHECK: ('_relocations', [ // CHECK: ]) -// CHECK: ('_section_data', '\xcf\xfa\xed\xfe\x07\x00\x00\x01') +// CHECK: ('_section_data', 'cffaedfe 07000001') // CHECK: ]) // CHECK: ), // CHECK: # Load Command 1 diff --git a/test/MC/MachO/tlv-reloc.s b/test/MC/MachO/tlv-reloc.s index 04fc7ae..d111241 100644 --- a/test/MC/MachO/tlv-reloc.s +++ b/test/MC/MachO/tlv-reloc.s @@ -24,7 +24,7 @@ _foo: // CHECK: ('cputype', 16777223) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 416) // CHECK: ('flag', 0) // CHECK: ('reserved', 0) @@ -61,7 +61,7 @@ _foo: // CHECK: (('word-0', 0x3), // CHECK: ('word-1', 0x9d000001)), // CHECK: ]) -// CHECK: ('_section_data', 'H\x8b=\x00\x00\x00\x00\xff\x17\xc3') +// CHECK: ('_section_data', '488b3d00 000000ff 17c3') // CHECK: # Section 1 // CHECK: (('section_name', '__thread_data\x00\x00\x00') // CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') @@ -78,7 +78,7 @@ _foo: // CHECK: ), // CHECK: ('_relocations', [ // CHECK: ]) -// CHECK: ('_section_data', '\x04\x00\x00\x00') +// CHECK: ('_section_data', '04000000') // CHECK: # Section 2 // CHECK: (('section_name', '__thread_vars\x00\x00\x00') // CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') @@ -101,7 +101,7 @@ _foo: // CHECK: (('word-0', 0x0), // CHECK: ('word-1', 0xe000003)), // CHECK: ]) -// CHECK: ('_section_data', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('_section_data', '00000000 00000000 00000000 00000000 00000000 00000000') // CHECK: ]) // CHECK: ), // CHECK: # Load Command 1 diff --git a/test/MC/MachO/tlv.s b/test/MC/MachO/tlv.s index 7dd7390..0fe028e 100644 --- a/test/MC/MachO/tlv.s +++ b/test/MC/MachO/tlv.s @@ -10,7 +10,7 @@ _a: // CHECK: ('cputype', 16777223) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 336) // CHECK: ('flag', 0) // CHECK: ('reserved', 0) @@ -61,7 +61,7 @@ _a: // CHECK: ), // CHECK: ('_relocations', [ // CHECK: ]) -// CHECK: ('_section_data', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('_section_data', '00000000 00000000 00000000 00000000 00000000 00000000') // CHECK: ]) // CHECK: ), // CHECK: # Load Command 1 diff --git a/test/MC/MachO/values.s b/test/MC/MachO/values.s index 2a472ab..9611599 100644 --- a/test/MC/MachO/values.s +++ b/test/MC/MachO/values.s @@ -20,7 +20,7 @@ data_def_ext: // CHECK: ('cputype', 7) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 296) // CHECK: ('flag', 0) // CHECK: ('load_commands', [ diff --git a/test/MC/MachO/weakdef.s b/test/MC/MachO/weakdef.s new file mode 100644 index 0000000..494079d --- /dev/null +++ b/test/MC/MachO/weakdef.s @@ -0,0 +1,141 @@ +// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s + + .section __DATA,__datacoal_nt,coalesced + .section __TEXT,__const_coal,coalesced + .globl __ZTS3optIbE ## @_ZTS3optIbE + .weak_definition __ZTS3optIbE +__ZTS3optIbE: + + + .section __DATA,__datacoal_nt,coalesced + .globl __ZTI3optIbE ## @_ZTI3optIbE + .weak_definition __ZTI3optIbE + +__ZTI3optIbE: + .long __ZTS3optIbE + +// CHECK: ('cputype', 7) +// CHECK-NEXT: ('cpusubtype', 3) +// CHECK-NEXT: ('filetype', 1) +// CHECK-NEXT: ('num_load_commands', 3) +// CHECK-NEXT: ('load_commands_size', 364) +// CHECK-NEXT: ('flag', 0) +// CHECK-NEXT: ('load_commands', [ +// CHECK-NEXT: # Load Command 0 +// CHECK-NEXT: (('command', 1) +// CHECK-NEXT: ('size', 260) +// CHECK-NEXT: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('vm_addr', 0) +// CHECK-NEXT: ('vm_size', 4) +// CHECK-NEXT: ('file_offset', 392) +// CHECK-NEXT: ('file_size', 4) +// CHECK-NEXT: ('maxprot', 7) +// CHECK-NEXT: ('initprot', 7) +// CHECK-NEXT: ('num_sections', 3) +// CHECK-NEXT: ('flags', 0) +// CHECK-NEXT: ('sections', [ +// CHECK-NEXT: # Section 0 +// CHECK-NEXT: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('address', 0) +// CHECK-NEXT: ('size', 0) +// CHECK-NEXT: ('offset', 392) +// CHECK-NEXT: ('alignment', 0) +// CHECK-NEXT: ('reloc_offset', 0) +// CHECK-NEXT: ('num_reloc', 0) +// CHECK-NEXT: ('flags', 0x80000000) +// CHECK-NEXT: ('reserved1', 0) +// CHECK-NEXT: ('reserved2', 0) +// CHECK-NEXT: ), +// CHECK-NEXT: ('_relocations', [ +// CHECK-NEXT: ]) +// CHECK-NEXT: ('_section_data', '') +// CHECK-NEXT: # Section 1 +// CHECK-NEXT: (('section_name', '__datacoal_nt\x00\x00\x00') +// CHECK-NEXT: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('address', 0) +// CHECK-NEXT: ('size', 4) +// CHECK-NEXT: ('offset', 392) +// CHECK-NEXT: ('alignment', 0) +// CHECK-NEXT: ('reloc_offset', 396) +// CHECK-NEXT: ('num_reloc', 1) +// CHECK-NEXT: ('flags', 0xb) +// CHECK-NEXT: ('reserved1', 0) +// CHECK-NEXT: ('reserved2', 0) +// CHECK-NEXT: ), +// CHECK-NEXT: ('_relocations', [ +// CHECK-NEXT: # Relocation 0 +// CHECK-NEXT: (('word-0', 0x0), +// CHECK-NEXT: ('word-1', 0xc000001)), +// CHECK-NEXT: ]) +// CHECK-NEXT: ('_section_data', '00000000') +// CHECK-NEXT: # Section 2 +// CHECK-NEXT: (('section_name', '__const_coal\x00\x00\x00\x00') +// CHECK-NEXT: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK-NEXT: ('address', 4) +// CHECK-NEXT: ('size', 0) +// CHECK-NEXT: ('offset', 396) +// CHECK-NEXT: ('alignment', 0) +// CHECK-NEXT: ('reloc_offset', 0) +// CHECK-NEXT: ('num_reloc', 0) +// CHECK-NEXT: ('flags', 0xb) +// CHECK-NEXT: ('reserved1', 0) +// CHECK-NEXT: ('reserved2', 0) +// CHECK-NEXT: ), +// CHECK-NEXT: ('_relocations', [ +// CHECK-NEXT: ]) +// CHECK-NEXT: ('_section_data', '') +// CHECK-NEXT: ]) +// CHECK-NEXT: ), +// CHECK-NEXT: # Load Command 1 +// CHECK-NEXT: (('command', 2) +// CHECK-NEXT: ('size', 24) +// CHECK-NEXT: ('symoff', 404) +// CHECK-NEXT: ('nsyms', 2) +// CHECK-NEXT: ('stroff', 428) +// CHECK-NEXT: ('strsize', 28) +// CHECK-NEXT: ('_string_data', '\x00__ZTS3optIbE\x00__ZTI3optIbE\x00\x00') +// CHECK-NEXT: ('_symbols', [ +// CHECK-NEXT: # Symbol 0 +// CHECK-NEXT: (('n_strx', 14) +// CHECK-NEXT: ('n_type', 0xf) +// CHECK-NEXT: ('n_sect', 2) +// CHECK-NEXT: ('n_desc', 128) +// CHECK-NEXT: ('n_value', 0) +// CHECK-NEXT: ('_string', '__ZTI3optIbE') +// CHECK-NEXT: ), +// CHECK-NEXT: # Symbol 1 +// CHECK-NEXT: (('n_strx', 1) +// CHECK-NEXT: ('n_type', 0xf) +// CHECK-NEXT: ('n_sect', 3) +// CHECK-NEXT: ('n_desc', 128) +// CHECK-NEXT: ('n_value', 4) +// CHECK-NEXT: ('_string', '__ZTS3optIbE') +// CHECK-NEXT: ), +// CHECK-NEXT: ]) +// CHECK-NEXT: ), +// CHECK-NEXT: # Load Command 2 +// CHECK-NEXT: (('command', 11) +// CHECK-NEXT: ('size', 80) +// CHECK-NEXT: ('ilocalsym', 0) +// CHECK-NEXT: ('nlocalsym', 0) +// CHECK-NEXT: ('iextdefsym', 0) +// CHECK-NEXT: ('nextdefsym', 2) +// CHECK-NEXT: ('iundefsym', 2) +// CHECK-NEXT: ('nundefsym', 0) +// CHECK-NEXT: ('tocoff', 0) +// CHECK-NEXT: ('ntoc', 0) +// CHECK-NEXT: ('modtaboff', 0) +// CHECK-NEXT: ('nmodtab', 0) +// CHECK-NEXT: ('extrefsymoff', 0) +// CHECK-NEXT: ('nextrefsyms', 0) +// CHECK-NEXT: ('indirectsymoff', 0) +// CHECK-NEXT: ('nindirectsyms', 0) +// CHECK-NEXT: ('extreloff', 0) +// CHECK-NEXT: ('nextrel', 0) +// CHECK-NEXT: ('locreloff', 0) +// CHECK-NEXT: ('nlocrel', 0) +// CHECK-NEXT: ('_indirect_symbols', [ +// CHECK-NEXT: ]) +// CHECK-NEXT: ), +// CHECK-NEXT: ]) diff --git a/test/MC/MachO/x86_32-optimal_nop.s b/test/MC/MachO/x86_32-optimal_nop.s index e6d41d7..2475140 100644 --- a/test/MC/MachO/x86_32-optimal_nop.s +++ b/test/MC/MachO/x86_32-optimal_nop.s @@ -104,7 +104,7 @@ ret ret # nopw %cs:0L(%[re]ax,%[re]ax,1) - # 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 + # 0x66, 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 .align 4, 0x90 ret # 12 byte nop test @@ -160,7 +160,7 @@ f0: // CHECK: ('cputype', 7) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 296) // CHECK: ('flag', 0) // CHECK: ('load_commands', [ @@ -192,7 +192,7 @@ f0: // CHECK: ), // CHECK: ('_relocations', [ // CHECK: ]) -// CHECK: ('_section_data', '\xc3\x90\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3f\x90\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\x0f\x1f\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3\x0f\x1f@\x00\xc3\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\x0f\x1fD\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\xc3\xc3f\x0f\x1fD\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\xc3\x0f\x1f\x80\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc3\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3\xc3\xc3\xc3f\x0f\x1f\x84\x00\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3\xc3\xc3\xc3f\x0f\x1f\x84\x00\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3\xc3\x0f\x1fD\x00\x00f\x0f\x1fD\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3f\x0f\x1fD\x00\x00f\x0f\x1fD\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3f\x0f\x1fD\x00\x00\x0f\x1f\x80\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\x0f\x1f\x80\x00\x00\x00\x00\x0f\x1f\x80\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\x0f\x1f\x80\x00\x00\x00\x00\x0f\x1f\x84\x00\x00\x00\x00\x00\xc3') +// CHECK: ('_section_data', 'c390c300 00000000 00000000 00000000 c3c36690 c3000000 00000000 00000000 c30f1f00 c3000000 00000000 00000000 c3c3c3c3 0f1f4000 c3000000 00000000 c3c3c30f 1f440000 c3000000 00000000 c3c3660f 1f440000 c3000000 00000000 c30f1f80 00000000 c3000000 00000000 c3c3c3c3 c3c3c3c3 c3000000 00000000 c3c3c3c3 c3c3c366 0f1f8400 00000000 c3000000 00000000 00000000 00000000 c3c3c3c3 c3c3c366 0f1f8400 00000000 c3000000 00000000 00000000 00000000 c3c3c3c3 c366662e 0f1f8400 00000000 c3000000 00000000 00000000 00000000 c3c3c3c3 6666662e 0f1f8400 00000000 c3000000 00000000 00000000 00000000 c3c3c366 6666662e 0f1f8400 00000000 c3000000 00000000 00000000 00000000 c3c36666 6666662e 0f1f8400 00000000 c3000000 00000000 00000000 00000000 c3666666 6666662e 0f1f8400 00000000 c3') // CHECK: # Section 1 // CHECK: (('section_name', '__const\x00\x00\x00\x00\x00\x00\x00\x00\x00') // CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') @@ -208,7 +208,7 @@ f0: // CHECK: ), // CHECK: ('_relocations', [ // CHECK: ]) -// CHECK: ('_section_data', '\x00\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x00\x00\x00\x00') +// CHECK: ('_section_data', '00909090 90909090 90909090 90909090 00000000') // CHECK: ]) // CHECK: ), // CHECK: # Load Command 1 diff --git a/test/MC/MachO/x86_32-symbols.s b/test/MC/MachO/x86_32-symbols.s index 629ba7d..35ada35 100644 --- a/test/MC/MachO/x86_32-symbols.s +++ b/test/MC/MachO/x86_32-symbols.s @@ -124,7 +124,7 @@ D39: // CHECK: ('cputype', 7) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 2608) // CHECK: ('flag', 0) // CHECK: ('load_commands', [ diff --git a/test/MC/MachO/x86_64-symbols.s b/test/MC/MachO/x86_64-symbols.s index c5c39a6..804cee8 100644 --- a/test/MC/MachO/x86_64-symbols.s +++ b/test/MC/MachO/x86_64-symbols.s @@ -124,7 +124,7 @@ D38: // CHECK: ('cputype', 16777223) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 2656) // CHECK: ('flag', 0) // CHECK: ('reserved', 0) diff --git a/test/MC/MachO/zerofill-1.s b/test/MC/MachO/zerofill-1.s index a175d4c..805a786 100644 --- a/test/MC/MachO/zerofill-1.s +++ b/test/MC/MachO/zerofill-1.s @@ -11,7 +11,7 @@ // CHECK: ('cputype', 7) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 364) // CHECK: ('flag', 0) // CHECK: ('load_commands', [ diff --git a/test/MC/MachO/zerofill-2.s b/test/MC/MachO/zerofill-2.s index e76de84..16577e4 100644 --- a/test/MC/MachO/zerofill-2.s +++ b/test/MC/MachO/zerofill-2.s @@ -8,7 +8,7 @@ // CHECK: ('cputype', 7) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 296) // CHECK: ('flag', 0) // CHECK: ('load_commands', [ diff --git a/test/MC/MachO/zerofill-3.s b/test/MC/MachO/zerofill-3.s index e7f4c7b..cc81fa8 100644 --- a/test/MC/MachO/zerofill-3.s +++ b/test/MC/MachO/zerofill-3.s @@ -22,7 +22,7 @@ // CHECK: ('cputype', 7) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 296) // CHECK: ('flag', 0) // CHECK: ('load_commands', [ diff --git a/test/MC/MachO/zerofill-5.s b/test/MC/MachO/zerofill-5.s index 3074f60..91f251b 100644 --- a/test/MC/MachO/zerofill-5.s +++ b/test/MC/MachO/zerofill-5.s @@ -9,7 +9,7 @@ // CHECK: ('cputype', 16777223) // CHECK: ('cpusubtype', 3) // CHECK: ('filetype', 1) -// CHECK: ('num_load_commands', 1) +// CHECK: ('num_load_commands', 3) // CHECK: ('load_commands_size', 336) // CHECK: ('flag', 0) // CHECK: ('reserved', 0) @@ -43,7 +43,7 @@ // CHECK: ), // CHECK: ('_relocations', [ // CHECK: ]) -// CHECK: ('_section_data', '\x02\x00\x00\x00') +// CHECK: ('_section_data', '02000000') // CHECK: # Section 1 // CHECK: (('section_name', '__bss\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') // CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') @@ -60,7 +60,7 @@ // CHECK: ), // CHECK: ('_relocations', [ // CHECK: ]) -// CHECK: ('_section_data', '\xcf\xfa\xed\xfe\x07\x00\x00\x01') +// CHECK: ('_section_data', 'cffaedfe 07000001') // CHECK: ]) // CHECK: ), // CHECK: # Load Command 1 |