1 // RUN: llvm-mc -triple x86_64-apple-darwin10 %s -filetype=obj -o %t.o
2 // RUN: llvm-readobj -file-headers -s -sd -r -t -macho-segment -macho-dysymtab -macho-indirect-symbols < %t.o > %t.dump
3 // RUN: FileCheck < %t.dump %s
11 .long (_c - L0) - (_d - L1) // == (_c - _d) + (L1 - L0)
18 // CHECK: File: <stdin>
19 // CHECK: Format: Mach-O 64-bit x86-64
20 // CHECK: Arch: x86_64
21 // CHECK: AddressSize: 64bit
22 // CHECK: MachHeader {
23 // CHECK: Magic: Magic64 (0xFEEDFACF)
24 // CHECK: CpuType: X86-64 (0x1000007)
25 // CHECK: CpuSubType: CPU_SUBTYPE_X86_64_ALL (0x3)
26 // CHECK: FileType: Relocatable (0x1)
27 // CHECK: NumOfLoadCommands: 4
28 // CHECK: SizeOfLoadCommands: 272
29 // CHECK: Flags [ (0x0)
31 // CHECK: Reserved: 0x0
36 // CHECK: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
37 // CHECK: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
38 // CHECK: Address: 0x0
41 // CHECK: Alignment: 0
42 // CHECK: RelocationOffset: 0x148
43 // CHECK: RelocationCount: 4
45 // CHECK: Attributes [ (0x800000)
46 // CHECK: PureInstructions (0x800000)
48 // CHECK: Reserved1: 0x0
49 // CHECK: Reserved2: 0x0
50 // CHECK: Reserved3: 0x0
51 // CHECK: SectionData (
52 // CHECK: 0000: 01000000 02000000 04000000 04000000 |................|
53 // CHECK: 0010: 00000000 00000000 |........|
57 // CHECK: Relocations [
58 // CHECK: Section __text {
59 // CHECK: 0xC 0 2 1 X86_64_RELOC_SUBTRACTOR 0 _d
60 // CHECK: 0xC 0 2 1 X86_64_RELOC_UNSIGNED 0 _c
61 // CHECK: 0x8 0 2 1 X86_64_RELOC_SUBTRACTOR 0 _d
62 // CHECK: 0x8 0 2 1 X86_64_RELOC_UNSIGNED 0 _c
67 // CHECK: Name: _a (7)
68 // CHECK: Type: Section (0xE)
69 // CHECK: Section: __text (0x1)
70 // CHECK: RefType: UndefinedNonLazy (0x0)
71 // CHECK: Flags [ (0x0)
76 // CHECK: Name: _c (4)
77 // CHECK: Type: Section (0xE)
78 // CHECK: Section: __text (0x1)
79 // CHECK: RefType: UndefinedNonLazy (0x0)
80 // CHECK: Flags [ (0x0)
85 // CHECK: Name: _d (1)
86 // CHECK: Type: Section (0xE)
87 // CHECK: Section: __text (0x1)
88 // CHECK: RefType: UndefinedNonLazy (0x0)
89 // CHECK: Flags [ (0x0)
94 // CHECK: Indirect Symbols {
100 // CHECK: Cmd: LC_SEGMENT_64
103 // CHECK: vmaddr: 0x0
104 // CHECK: vmsize: 0x18
105 // CHECK: fileoff: 304
106 // CHECK: filesize: 24
107 // CHECK: maxprot: rwx
108 // CHECK: initprot: rwx
113 // CHECK: ilocalsym: 0
114 // CHECK: nlocalsym: 3
115 // CHECK: iextdefsym: 3
116 // CHECK: nextdefsym: 0
117 // CHECK: iundefsym: 3
118 // CHECK: nundefsym: 0
121 // CHECK: modtaboff: 0
123 // CHECK: extrefsymoff: 0
124 // CHECK: nextrefsyms: 0
125 // CHECK: indirectsymoff: 0
126 // CHECK: nindirectsyms: 0
127 // CHECK: extreloff: 0
129 // CHECK: locreloff: 0