1 ## a) Test that yaml2macho is able to emit the .debug_aranges section and obj2yaml
2 ## is able to convert it back.
4 # RUN: yaml2obj --docnum=1 %s | obj2yaml | FileCheck %s
10 cpusubtype: 0x00000003
19 uuid: B4D48511-37F4-3ED4-AFA7-1683DCE69AC4
51 addr: 0x0000000100000F50
63 addr: 0x0000000100000F84
73 - sectname: __stub_helper
75 addr: 0x0000000100000F8C
87 addr: 0x0000000100000FA6
97 - sectname: __unwind_info
99 addr: 0x0000000100000FB4
106 reserved1: 0x00000000
107 reserved2: 0x00000000
108 reserved3: 0x00000000
121 - sectname: __nl_symbol_ptr
123 addr: 0x0000000100001000
130 reserved1: 0x00000001
131 reserved2: 0x00000000
132 reserved3: 0x00000000
133 - sectname: __la_symbol_ptr
135 addr: 0x0000000100001010
142 reserved1: 0x00000003
143 reserved2: 0x00000000
144 reserved3: 0x00000000
168 - sectname: __debug_line
170 addr: 0x0000000100003000
177 reserved1: 0x00000000
178 reserved2: 0x00000000
179 reserved3: 0x00000000
180 - sectname: __debug_pubnames
182 addr: 0x0000000100003045
189 reserved1: 0x00000000
190 reserved2: 0x00000000
191 reserved3: 0x00000000
192 - sectname: __debug_pubtypes
194 addr: 0x0000000100003060
201 reserved1: 0x00000000
202 reserved2: 0x00000000
203 reserved3: 0x00000000
204 - sectname: __debug_aranges
206 addr: 0x0000000100003083
213 reserved1: 0x00000000
214 reserved2: 0x00000000
215 reserved3: 0x00000000
216 - sectname: __debug_info
218 addr: 0x00000001000030B3
225 reserved1: 0x00000000
226 reserved2: 0x00000000
227 reserved3: 0x00000000
228 - sectname: __debug_abbrev
230 addr: 0x000000010000312C
237 reserved1: 0x00000000
238 reserved2: 0x00000000
239 reserved3: 0x00000000
240 - sectname: __debug_str
242 addr: 0x0000000100003178
249 reserved1: 0x00000000
250 reserved2: 0x00000000
251 reserved3: 0x00000000
252 - sectname: __apple_names
254 addr: 0x0000000100003206
261 reserved1: 0x00000000
262 reserved2: 0x00000000
263 reserved3: 0x00000000
264 - sectname: __apple_namespac
266 addr: 0x0000000100003242
273 reserved1: 0x00000000
274 reserved2: 0x00000000
275 reserved3: 0x00000000
276 - sectname: __apple_types
278 addr: 0x0000000100003266
285 reserved1: 0x00000000
286 reserved2: 0x00000000
287 reserved3: 0x00000000
288 - sectname: __apple_objc
290 addr: 0x00000001000032D8
297 reserved1: 0x00000000
298 reserved2: 0x00000000
299 reserved3: 0x00000000
315 - __mh_execute_header
323 SegmentSelectorSize: 0
325 - Address: 0x0000000100000F50
329 # CHECK: debug_aranges:
330 # CHECK-NEXT: - Length: 0x2C
331 # CHECK-NEXT: Version: 2
332 # CHECK-NEXT: CuOffset: 0x0
333 # CHECK-NEXT: AddressSize: 0x8
334 # CHECK-NEXT: Descriptors:
335 # CHECK-NEXT: - Address: 0x100000F50
336 # CHECK-NEXT: Length: 0x34
338 ## b) Test that if the "debug_aranges" entry is empty, yaml2macho will only emit the
341 # RUN: yaml2obj --docnum=2 %s -o %t2.o
342 # RUN: llvm-readobj --sections --section-data %t2.o | FileCheck %s --check-prefix=EMPTY-SECTION
344 # EMPTY-SECTION: Index: 0
345 # EMPTY-SECTION-NEXT: Name: __debug_aranges (5F 5F 64 65 62 75 67 5F 61 72 61 6E 67 65 73 00)
346 # EMPTY-SECTION-NEXT: Segment: __DWARF (5F 5F 44 57 41 52 46 00 00 00 00 00 00 00 00 00)
347 # EMPTY-SECTION-NEXT: Address: 0x0
348 # EMPTY-SECTION-NEXT: Size: 0xC
349 # EMPTY-SECTION-NEXT: Offset: 528
350 # EMPTY-SECTION-NEXT: Alignment: 0
351 # EMPTY-SECTION-NEXT: RelocationOffset: 0x0
352 # EMPTY-SECTION-NEXT: RelocationCount: 0
353 # EMPTY-SECTION-NEXT: Type: Regular (0x0)
354 # EMPTY-SECTION-NEXT: Attributes [ (0x0)
355 # EMPTY-SECTION-NEXT: ]
356 # EMPTY-SECTION-NEXT: Reserved1: 0x0
357 # EMPTY-SECTION-NEXT: Reserved2: 0x0
358 # EMPTY-SECTION-NEXT: Reserved3: 0x0
359 # EMPTY-SECTION-NEXT: SectionData (
360 # EMPTY-SECTION-NEXT: )
366 cpusubtype: 0x00000003
385 - sectname: __debug_aranges
394 reserved1: 0x00000000
395 reserved2: 0x00000000
396 reserved3: 0x00000000