2009-08-26 13:58:10 +00:00
|
|
|
// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s
|
|
|
|
|
|
|
|
.data
|
|
|
|
.long undef
|
|
|
|
.long (undef + 4)
|
|
|
|
|
|
|
|
.globl local_a_ext
|
|
|
|
local_a_ext:
|
|
|
|
.long local_a_ext
|
|
|
|
|
|
|
|
local_a:
|
|
|
|
.long 0
|
2010-03-19 03:18:12 +00:00
|
|
|
local_a_elt:
|
2009-08-26 13:58:10 +00:00
|
|
|
.long 0
|
|
|
|
local_b:
|
|
|
|
.long local_b - local_c + 245
|
|
|
|
.long 0
|
|
|
|
local_c:
|
|
|
|
.long 0
|
|
|
|
|
|
|
|
|
|
|
|
.long local_a_elt + 1
|
|
|
|
.long local_a_elt + 10
|
|
|
|
.short local_a_elt + 20
|
|
|
|
.byte local_a_elt + 89
|
|
|
|
|
|
|
|
.const
|
|
|
|
|
|
|
|
.long
|
2010-03-19 03:18:12 +00:00
|
|
|
bar:
|
2009-08-26 13:58:10 +00:00
|
|
|
.long local_a_elt - bar + 33
|
|
|
|
|
2010-03-19 03:18:12 +00:00
|
|
|
L0:
|
|
|
|
.long L0
|
|
|
|
.long L1
|
|
|
|
|
|
|
|
.text
|
|
|
|
_f0:
|
|
|
|
L1:
|
|
|
|
jmp L0
|
|
|
|
jmp L1
|
|
|
|
ret
|
|
|
|
|
2010-05-05 19:01:05 +00:00
|
|
|
.objc_class_name_A=0
|
|
|
|
.globl .objc_class_name_A
|
|
|
|
|
2010-05-07 21:44:23 +00:00
|
|
|
.text
|
|
|
|
.globl _f1
|
|
|
|
.weak_definition _f1
|
|
|
|
_f1:
|
|
|
|
.data
|
|
|
|
.long _f1
|
2010-05-10 23:15:20 +00:00
|
|
|
.long _f1 + 4
|
2010-05-07 21:44:23 +00:00
|
|
|
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ('cputype', 7)
|
|
|
|
// CHECK: ('cpusubtype', 3)
|
|
|
|
// CHECK: ('filetype', 1)
|
|
|
|
// CHECK: ('num_load_commands', 1)
|
|
|
|
// 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)
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: ('vm_size', 71)
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ('file_offset', 392)
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: ('file_size', 71)
|
2009-08-26 13:58:10 +00:00
|
|
|
// 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)
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: ('size', 8)
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ('offset', 392)
|
|
|
|
// CHECK: ('alignment', 0)
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: ('reloc_offset', 464)
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: ('num_reloc', 1)
|
|
|
|
// CHECK: ('flags', 0x80000400)
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ('reserved1', 0)
|
|
|
|
// CHECK: ('reserved2', 0)
|
|
|
|
// CHECK: ),
|
|
|
|
// CHECK: ('_relocations', [
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: # Relocation 0
|
|
|
|
// CHECK: (('word-0', 0x1),
|
|
|
|
// CHECK: ('word-1', 0x5000003)),
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ])
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: ('_section_data', '\xe9:\x00\x00\x00\xeb\xf9\xc3')
|
2009-08-26 13:58:10 +00:00
|
|
|
// 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')
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: ('address', 8)
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: ('size', 51)
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: ('offset', 400)
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ('alignment', 0)
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: ('reloc_offset', 472)
|
|
|
|
// CHECK: ('num_reloc', 11)
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ('flags', 0x0)
|
|
|
|
// CHECK: ('reserved1', 0)
|
|
|
|
// CHECK: ('reserved2', 0)
|
|
|
|
// CHECK: ),
|
|
|
|
// CHECK: ('_relocations', [
|
|
|
|
// CHECK: # Relocation 0
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: (('word-0', 0x2f),
|
2010-05-07 21:44:23 +00:00
|
|
|
// CHECK: ('word-1', 0xc000007)),
|
|
|
|
// CHECK: # Relocation 1
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: (('word-0', 0x2b),
|
|
|
|
// CHECK: ('word-1', 0xc000007)),
|
|
|
|
// CHECK: # Relocation 2
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: (('word-0', 0x8000002a),
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: ('word-1', 0x18)),
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: # Relocation 3
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: (('word-0', 0x90000028),
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: ('word-1', 0x18)),
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: # Relocation 4
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: (('word-0', 0xa0000024),
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: ('word-1', 0x18)),
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: # Relocation 5
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: (('word-0', 0xa0000020),
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: ('word-1', 0x18)),
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: # Relocation 6
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: (('word-0', 0xa4000014),
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: ('word-1', 0x1c)),
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: # Relocation 7
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: (('word-0', 0xa1000000),
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: ('word-1', 0x24)),
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: # Relocation 8
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: (('word-0', 0x8),
|
|
|
|
// CHECK: ('word-1', 0x4000002)),
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: # Relocation 9
|
2010-05-07 21:44:23 +00:00
|
|
|
// CHECK: (('word-0', 0x4),
|
|
|
|
// CHECK: ('word-1', 0xc000009)),
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: # Relocation 10
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: (('word-0', 0x0),
|
2010-05-07 21:44:23 +00:00
|
|
|
// CHECK: ('word-1', 0xc000009)),
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ])
|
2010-05-10 23:15:20 +00:00
|
|
|
// 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')
|
2009-08-26 13:58:10 +00:00
|
|
|
// 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')
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: ('address', 59)
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: ('size', 12)
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: ('offset', 451)
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ('alignment', 0)
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: ('reloc_offset', 560)
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: ('num_reloc', 4)
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ('flags', 0x0)
|
|
|
|
// CHECK: ('reserved1', 0)
|
|
|
|
// CHECK: ('reserved2', 0)
|
|
|
|
// CHECK: ),
|
|
|
|
// CHECK: ('_relocations', [
|
|
|
|
// CHECK: # Relocation 0
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: (('word-0', 0x8),
|
|
|
|
// CHECK: ('word-1', 0x4000001)),
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: # Relocation 1
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: (('word-0', 0x4),
|
|
|
|
// CHECK: ('word-1', 0x4000003)),
|
|
|
|
// CHECK: # Relocation 2
|
|
|
|
// CHECK: (('word-0', 0xa4000000),
|
|
|
|
// CHECK: ('word-1', 0x18)),
|
|
|
|
// CHECK: # Relocation 3
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: (('word-0', 0xa1000000),
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: ('word-1', 0x3b)),
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ])
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: ('_section_data', '\xfe\xff\xff\xff?\x00\x00\x00\x00\x00\x00\x00')
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ])
|
|
|
|
// CHECK: ),
|
|
|
|
// CHECK: # Load Command 1
|
|
|
|
// CHECK: (('command', 2)
|
|
|
|
// CHECK: ('size', 24)
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: ('symoff', 592)
|
2010-05-07 21:44:23 +00:00
|
|
|
// CHECK: ('nsyms', 10)
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: ('stroff', 712)
|
2010-05-07 21:44:23 +00:00
|
|
|
// 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')
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ('_symbols', [
|
|
|
|
// CHECK: # Symbol 0
|
2010-05-07 21:44:23 +00:00
|
|
|
// CHECK: (('n_strx', 42)
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ('n_type', 0xe)
|
|
|
|
// CHECK: ('n_sect', 2)
|
|
|
|
// CHECK: ('n_desc', 0)
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: ('n_value', 20)
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ('_string', 'local_a')
|
|
|
|
// CHECK: ),
|
|
|
|
// CHECK: # Symbol 1
|
2010-05-07 21:44:23 +00:00
|
|
|
// CHECK: (('n_strx', 50)
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ('n_type', 0xe)
|
|
|
|
// CHECK: ('n_sect', 2)
|
|
|
|
// CHECK: ('n_desc', 0)
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: ('n_value', 24)
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ('_string', 'local_a_elt')
|
|
|
|
// CHECK: ),
|
|
|
|
// CHECK: # Symbol 2
|
2010-05-07 21:44:23 +00:00
|
|
|
// CHECK: (('n_strx', 62)
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ('n_type', 0xe)
|
|
|
|
// CHECK: ('n_sect', 2)
|
|
|
|
// CHECK: ('n_desc', 0)
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: ('n_value', 28)
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ('_string', 'local_b')
|
|
|
|
// CHECK: ),
|
|
|
|
// CHECK: # Symbol 3
|
2010-05-07 21:44:23 +00:00
|
|
|
// CHECK: (('n_strx', 70)
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ('n_type', 0xe)
|
|
|
|
// CHECK: ('n_sect', 2)
|
|
|
|
// CHECK: ('n_desc', 0)
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: ('n_value', 36)
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ('_string', 'local_c')
|
|
|
|
// CHECK: ),
|
|
|
|
// CHECK: # Symbol 4
|
2010-05-07 21:44:23 +00:00
|
|
|
// CHECK: (('n_strx', 78)
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ('n_type', 0xe)
|
|
|
|
// CHECK: ('n_sect', 3)
|
|
|
|
// CHECK: ('n_desc', 0)
|
2010-05-10 23:15:20 +00:00
|
|
|
// CHECK: ('n_value', 59)
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ('_string', 'bar')
|
|
|
|
// CHECK: ),
|
|
|
|
// CHECK: # Symbol 5
|
2010-05-07 21:44:23 +00:00
|
|
|
// CHECK: (('n_strx', 82)
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: ('n_type', 0xe)
|
|
|
|
// CHECK: ('n_sect', 1)
|
|
|
|
// CHECK: ('n_desc', 0)
|
|
|
|
// CHECK: ('n_value', 0)
|
|
|
|
// CHECK: ('_string', '_f0')
|
|
|
|
// CHECK: ),
|
|
|
|
// CHECK: # Symbol 6
|
2010-05-05 19:01:05 +00:00
|
|
|
// CHECK: (('n_strx', 19)
|
|
|
|
// CHECK: ('n_type', 0x3)
|
|
|
|
// CHECK: ('n_sect', 0)
|
|
|
|
// CHECK: ('n_desc', 0)
|
|
|
|
// CHECK: ('n_value', 0)
|
|
|
|
// CHECK: ('_string', '.objc_class_name_A')
|
|
|
|
// CHECK: ),
|
|
|
|
// CHECK: # Symbol 7
|
2010-05-07 21:44:23 +00:00
|
|
|
// CHECK: (('n_strx', 38)
|
|
|
|
// CHECK: ('n_type', 0xf)
|
|
|
|
// CHECK: ('n_sect', 1)
|
|
|
|
// CHECK: ('n_desc', 128)
|
|
|
|
// CHECK: ('n_value', 8)
|
|
|
|
// CHECK: ('_string', '_f1')
|
|
|
|
// CHECK: ),
|
|
|
|
// CHECK: # Symbol 8
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: (('n_strx', 7)
|
|
|
|
// CHECK: ('n_type', 0xf)
|
|
|
|
// CHECK: ('n_sect', 2)
|
|
|
|
// CHECK: ('n_desc', 0)
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: ('n_value', 16)
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: ('_string', 'local_a_ext')
|
|
|
|
// CHECK: ),
|
2010-05-07 21:44:23 +00:00
|
|
|
// CHECK: # Symbol 9
|
2009-08-26 13:58:10 +00:00
|
|
|
// CHECK: (('n_strx', 1)
|
|
|
|
// CHECK: ('n_type', 0x1)
|
|
|
|
// CHECK: ('n_sect', 0)
|
|
|
|
// CHECK: ('n_desc', 0)
|
|
|
|
// CHECK: ('n_value', 0)
|
|
|
|
// CHECK: ('_string', 'undef')
|
|
|
|
// CHECK: ),
|
|
|
|
// CHECK: ])
|
|
|
|
// CHECK: ),
|
|
|
|
// CHECK: # Load Command 2
|
|
|
|
// CHECK: (('command', 11)
|
|
|
|
// CHECK: ('size', 80)
|
|
|
|
// CHECK: ('ilocalsym', 0)
|
2010-03-19 03:18:12 +00:00
|
|
|
// CHECK: ('nlocalsym', 6)
|
|
|
|
// CHECK: ('iextdefsym', 6)
|
2010-05-07 21:44:23 +00:00
|
|
|
// CHECK: ('nextdefsym', 3)
|
|
|
|
// CHECK: ('iundefsym', 9)
|
2009-08-26 13:58:10 +00:00
|
|
|
// 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: ])
|