1 // RUN: llvm-mc -triple x86_64-apple-darwin %s -filetype=obj -o - | llvm-readobj -file-headers -s -sd -r -t -macho-segment -macho-dysymtab -macho-indirect-symbols | FileCheck %s
20 movq _a@TLVP(%rip), %rdi
21 call *(%rdi) # returns &a in %rax
24 // CHECK: File: <stdin>
25 // CHECK: Format: Mach-O 64-bit x86-64
26 // CHECK: Arch: x86_64
27 // CHECK: AddressSize: 64bit
28 // CHECK: MachHeader {
29 // CHECK: Magic: Magic64 (0xFEEDFACF)
30 // CHECK: CpuType: X86-64 (0x1000007)
31 // CHECK: CpuSubType: CPU_SUBTYPE_X86_64_ALL (0x3)
32 // CHECK: FileType: Relocatable (0x1)
33 // CHECK: NumOfLoadCommands: 3
34 // CHECK: SizeOfLoadCommands: 416
35 // CHECK: Flags [ (0x0)
37 // CHECK: Reserved: 0x0
42 // CHECK: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
43 // CHECK: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
44 // CHECK: Address: 0x0
47 // CHECK: Alignment: 4
48 // CHECK: RelocationOffset: 0x1E8
49 // CHECK: RelocationCount: 1
51 // CHECK: Attributes [ (0x800004)
52 // CHECK: PureInstructions (0x800000)
53 // CHECK: SomeInstructions (0x4)
55 // CHECK: Reserved1: 0x0
56 // CHECK: Reserved2: 0x0
57 // CHECK: Reserved3: 0x0
58 // CHECK: SectionData (
59 // CHECK: 0000: 488B3D00 000000FF 17C3 |H.=.......|
64 // CHECK: Name: __thread_data (5F 5F 74 68 72 65 61 64 5F 64 61 74 61 00 00 00)
65 // CHECK: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
66 // CHECK: Address: 0xA
69 // CHECK: Alignment: 0
70 // CHECK: RelocationOffset: 0x0
71 // CHECK: RelocationCount: 0
73 // CHECK: Attributes [ (0x0)
75 // CHECK: Reserved1: 0x0
76 // CHECK: Reserved2: 0x0
77 // CHECK: Reserved3: 0x0
78 // CHECK: SectionData (
79 // CHECK: 0000: 04000000 |....|
84 // CHECK: Name: __thread_vars (5F 5F 74 68 72 65 61 64 5F 76 61 72 73 00 00 00)
85 // CHECK: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
86 // CHECK: Address: 0xE
89 // CHECK: Alignment: 0
90 // CHECK: RelocationOffset: 0x1F0
91 // CHECK: RelocationCount: 2
93 // CHECK: Attributes [ (0x0)
95 // CHECK: Reserved1: 0x0
96 // CHECK: Reserved2: 0x0
97 // CHECK: Reserved3: 0x0
98 // CHECK: SectionData (
99 // CHECK: 0000: 00000000 00000000 00000000 00000000 |................|
100 // CHECK: 0010: 00000000 00000000 |........|
104 // CHECK: Relocations [
105 // CHECK: Section __text {
106 // CHECK: 0x3 1 2 1 X86_64_RELOC_TLV 0 _a
108 // CHECK: Section __thread_vars {
109 // CHECK: 0x10 0 3 1 X86_64_RELOC_UNSIGNED 0 _a$tlv$init
110 // CHECK: 0x0 0 3 1 X86_64_RELOC_UNSIGNED 0 __tlv_bootstrap
115 // CHECK: Name: _a$tlv$init (1)
116 // CHECK: Type: Section (0xE)
117 // CHECK: Section: __thread_data (0x2)
118 // CHECK: RefType: UndefinedNonLazy (0x0)
119 // CHECK: Flags [ (0x0)
124 // CHECK: Name: _a (34)
126 // CHECK: Type: Section (0xE)
127 // CHECK: Section: __thread_vars (0x3)
128 // CHECK: RefType: UndefinedNonLazy (0x0)
129 // CHECK: Flags [ (0x0)
134 // CHECK: Name: _foo (29)
136 // CHECK: Type: Section (0xE)
137 // CHECK: Section: __text (0x1)
138 // CHECK: RefType: UndefinedNonLazy (0x0)
139 // CHECK: Flags [ (0x0)
144 // CHECK: Name: __tlv_bootstrap (13)
146 // CHECK: Type: Undef (0x0)
147 // CHECK: Section: (0x0)
148 // CHECK: RefType: UndefinedNonLazy (0x0)
149 // CHECK: Flags [ (0x0)
154 // CHECK: Indirect Symbols {
160 // CHECK: Cmd: LC_SEGMENT_64
163 // CHECK: vmaddr: 0x0
164 // CHECK: vmsize: 0x26
165 // CHECK: fileoff: 448
166 // CHECK: filesize: 38
167 // CHECK: maxprot: rwx
168 // CHECK: initprot: rwx
173 // CHECK: ilocalsym: 0
174 // CHECK: nlocalsym: 1
175 // CHECK: iextdefsym: 1
176 // CHECK: nextdefsym: 2
177 // CHECK: iundefsym: 3
178 // CHECK: nundefsym: 1
181 // CHECK: modtaboff: 0
183 // CHECK: extrefsymoff: 0
184 // CHECK: nextrefsyms: 0
185 // CHECK: indirectsymoff: 0
186 // CHECK: nindirectsyms: 0
187 // CHECK: extreloff: 0
189 // CHECK: locreloff: 0