1 # ppc32-debug-names.s was generated with:
3 # clang++ --target=powerpc -g -gpubnames \
4 # -fdebug-compilation-dir='/self/proc/cwd' -S a.cpp -o a.s
12 # RUN: rm -rf %t && split-file %s %t && cd %t
13 # RUN: llvm-mc -filetype=obj -triple=powerpc a.s -o a.o
14 # RUN: llvm-mc -filetype=obj -triple=powerpc b.s -o b.o
16 # RUN: ld.lld --debug-names --no-debug-names a.o b.o -o out0
17 # RUN: llvm-readelf -SW out0 | FileCheck %s --check-prefix=NO_MERGE
19 # NO_MERGE: Name Type Address Off Size ES Flg Lk Inf Al
20 # NO_MERGE: .debug_names PROGBITS 00000000 [[#%x,]] 000110 00 0 0 4
22 # RUN: ld.lld --debug-names a.o b.o -o out
24 # RUN: llvm-dwarfdump -debug-names out | FileCheck %s --check-prefix=DWARF
25 # RUN: llvm-readelf -SW out | FileCheck %s --check-prefix=READELF
27 # READELF: Name Type Address Off Size ES Flg Lk Inf Al
28 # READELF: .debug_names PROGBITS 00000000 [[#%x,]] 0000cc 00 0 0 4
30 # DWARF: file format elf32-powerpc
31 # DWARF: .debug_names contents:
32 # DWARF: Name Index @ 0x0 {
33 # DWARF-NEXT: Header {
34 # DWARF-NEXT: Length: 0xC8
35 # DWARF-NEXT: Format: DWARF32
36 # DWARF-NEXT: Version: 5
37 # DWARF-NEXT: CU count: 2
38 # DWARF-NEXT: Local TU count: 0
39 # DWARF-NEXT: Foreign TU count: 0
40 # DWARF-NEXT: Bucket count: 5
41 # DWARF-NEXT: Name count: 5
42 # DWARF-NEXT: Abbreviations table size: 0x1F
43 # DWARF-NEXT: Augmentation: 'LLVM0700'
44 # DWARF: Compilation Unit offsets [
45 # DWARF-NEXT: CU[0]: 0x00000000
46 # DWARF-NEXT: CU[1]: 0x0000000c
47 # DWARF: Abbreviations [
48 # DWARF-NEXT: Abbreviation 0x1 {
49 # DWARF: Tag: DW_TAG_structure_type
50 # DWARF-NEXT: DW_IDX_die_offset: DW_FORM_ref4
51 # DWARF-NEXT: DW_IDX_parent: DW_FORM_flag_present
52 # DWARF-NEXT: DW_IDX_compile_unit: DW_FORM_data1
53 # DWARF: Abbreviation 0x2 {
54 # DWARF-NEXT: Tag: DW_TAG_subprogram
55 # DWARF-NEXT: DW_IDX_die_offset: DW_FORM_ref4
56 # DWARF-NEXT: DW_IDX_parent: DW_FORM_flag_present
57 # DWARF-NEXT: DW_IDX_compile_unit: DW_FORM_data1
58 # DWARF: Abbreviation 0x3 {
59 # DWARF-NEXT: Tag: DW_TAG_base_type
60 # DWARF-NEXT: DW_IDX_die_offset: DW_FORM_ref4
61 # DWARF-NEXT: DW_IDX_parent: DW_FORM_flag_present
62 # DWARF-NEXT: DW_IDX_compile_unit: DW_FORM_data1
66 # DWARF-NEXT: Bucket 1 [
67 # DWARF-NEXT: Name 1 {
68 # DWARF-NEXT: Hash: 0x59796A
69 # DWARF-NEXT: String: 0x00000089 "t1"
70 # DWARF-NEXT: Entry @ 0xaa {
71 # DWARF-NEXT: Abbrev: 0x1
72 # DWARF-NEXT: Tag: DW_TAG_structure_type
73 # DWARF-NEXT: DW_IDX_die_offset: 0x0000003a
74 # DWARF-NEXT: DW_IDX_parent: <parent not indexed>
75 # DWARF-NEXT: DW_IDX_compile_unit: 0x00
77 # DWARF-NEXT: Entry @ 0xb0 {
78 # DWARF-NEXT: Abbrev: 0x1
79 # DWARF-NEXT: Tag: DW_TAG_structure_type
80 # DWARF-NEXT: DW_IDX_die_offset: 0x00000042
81 # DWARF-NEXT: DW_IDX_parent: <parent not indexed>
82 # DWARF-NEXT: DW_IDX_compile_unit: 0x01
85 # DWARF-NEXT: Name 2 {
86 # DWARF-NEXT: Hash: 0x5355B2BE
87 # DWARF-NEXT: String: 0x00000080 "_Z2f12t1"
88 # DWARF-NEXT: Entry @ 0xbe {
89 # DWARF-NEXT: Abbrev: 0x2
90 # DWARF-NEXT: Tag: DW_TAG_subprogram
91 # DWARF-NEXT: DW_IDX_die_offset: 0x00000023
92 # DWARF-NEXT: DW_IDX_parent: <parent not indexed>
93 # DWARF-NEXT: DW_IDX_compile_unit: 0x00
96 # DWARF-NEXT: Name 3 {
97 # DWARF-NEXT: Hash: 0x7C9A7F6A
98 # DWARF-NEXT: String: 0x0000010d "main"
99 # DWARF-NEXT: Entry @ 0xc5 {
100 # DWARF-NEXT: Abbrev: 0x2
101 # DWARF-NEXT: Tag: DW_TAG_subprogram
102 # DWARF-NEXT: DW_IDX_die_offset: 0x00000023
103 # DWARF-NEXT: DW_IDX_parent: <parent not indexed>
104 # DWARF-NEXT: DW_IDX_compile_unit: 0x01
108 # DWARF-NEXT: Bucket 2 [
111 # DWARF-NEXT: Bucket 3 [
112 # DWARF-NEXT: Name 4 {
113 # DWARF-NEXT: Hash: 0xB888030
114 # DWARF-NEXT: String: 0x00000112 "int"
115 # DWARF-NEXT: Entry @ 0xb7 {
116 # DWARF-NEXT: Abbrev: 0x3
117 # DWARF-NEXT: Tag: DW_TAG_base_type
118 # DWARF-NEXT: DW_IDX_die_offset: 0x0000003e
119 # DWARF-NEXT: DW_IDX_parent: <parent not indexed>
120 # DWARF-NEXT: DW_IDX_compile_unit: 0x01
124 # DWARF-NEXT: Bucket 4 [
125 # DWARF-NEXT: Name 5 {
126 # DWARF-NEXT: Hash: 0x59779C
127 # DWARF-NEXT: String: 0x0000007d "f1"
128 # DWARF-NEXT: Entry @ 0xa3 {
129 # DWARF-NEXT: Abbrev: 0x2
130 # DWARF-NEXT: Tag: DW_TAG_subprogram
131 # DWARF-NEXT: DW_IDX_die_offset: 0x00000023
132 # DWARF-NEXT: DW_IDX_parent: <parent not indexed>
133 # DWARF-NEXT: DW_IDX_compile_unit: 0x00
140 .globl _Z2f12t1 # -- Begin function _Z2f12t1
142 .type _Z2f12t1,@function
143 _Z2f12t1
: # @_Z2f12t1
147 #DEBUG_VALUE: f1: <- [$r3+0]
150 .cfi_def_cfa_offset 16
153 .cfi_def_cfa_register r31
160 .size _Z2f12t1, .Lfunc_end0-.Lfunc_begin0
163 .section .debug_abbrev,"",@progbits
167 .section .debug_info,"",@progbits
169 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
171 .short 5 # DWARF version number
172 .byte 1 # DWARF Unit Type
173 .byte 4 # Address Size (in bytes)
174 .long .debug_abbrev # Offset Into Abbrev. Section
176 .section .debug_str_offsets,"",@progbits
177 .long 28 # Length of String Offsets Set
181 .section .debug_str,"MS",@progbits,1
183 .asciz "clang version 19.0.0git (git@github.com:llvm/llvm-project.git 53b14cd9ce2b57da73d173fc876d2e9e199f5640)" # string offset=0
185 .asciz "a.cpp" # string offset=104
187 .asciz "/proc/self/cwd" # string offset=110
189 .asciz "f1" # string offset=125
191 .asciz "_Z2f12t1" # string offset=128
193 .asciz "t1" # string offset=137
197 .section .debug_names,"",@progbits
198 .long .Lnames_end0-.Lnames_start0 # Header: unit length
200 .short 5 # Header: version
201 .short 0 # Header: padding
202 .long 1 # Header: compilation unit count
203 .long 0 # Header: local type unit count
204 .long 0 # Header: foreign type unit count
205 .long 3 # Header: bucket count
206 .long 3 # Header: name count
207 .long .Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size
208 .long 8 # Header: augmentation string size
209 .ascii "LLVM0700" # Header: augmentation string
210 .long .Lcu_begin0 # Compilation unit 0
214 .long 5863324 # Hash in Bucket 1
215 .long 5863786 # Hash in Bucket 1
216 .long 1398125246 # Hash in Bucket 2
217 .long .Linfo_string3 # String in Bucket 1: f1
218 .long .Linfo_string5 # String in Bucket 1: t1
219 .long .Linfo_string4 # String in Bucket 2: _Z2f12t1
220 .long .Lnames0-.Lnames_entries0 # Offset in Bucket 1
221 .long .Lnames2-.Lnames_entries0 # Offset in Bucket 1
222 .long .Lnames1-.Lnames_entries0 # Offset in Bucket 2
223 .Lnames_abbrev_start0:
224 .byte 1 # Abbrev code
225 .byte 46 # DW_TAG_subprogram
226 .byte 3 # DW_IDX_die_offset
227 .byte 19 # DW_FORM_ref4
228 .byte 4 # DW_IDX_parent
229 .byte 25 # DW_FORM_flag_present
230 .byte 0 # End of abbrev
231 .byte 0 # End of abbrev
232 .byte 2 # Abbrev code
233 .byte 19 # DW_TAG_structure_type
234 .byte 3 # DW_IDX_die_offset
235 .byte 19 # DW_FORM_ref4
236 .byte 4 # DW_IDX_parent
237 .byte 25 # DW_FORM_flag_present
238 .byte 0 # End of abbrev
239 .byte 0 # End of abbrev
240 .byte 0 # End of abbrev list
245 .byte 1 # Abbreviation code
246 .long 35 # DW_IDX_die_offset
247 .byte 0 # DW_IDX_parent
251 .byte 2 # Abbreviation code
252 .long 58 # DW_IDX_die_offset
253 .byte 0 # DW_IDX_parent
256 .byte 1 # Abbreviation code
257 .long 35 # DW_IDX_die_offset
258 .byte 0 # DW_IDX_parent
259 # End of list: _Z2f12t1
262 .ident "clang version 19.0.0git (git@github.com:llvm/llvm-project.git 53b14cd9ce2b57da73d173fc876d2e9e199f5640)"
263 .section ".note.GNU-stack","",@progbits
265 .section .debug_line,"",@progbits
270 # - clang++ --target=powerpc -g -O0 -gpubnames \
271 # -fdebug-compilation-dir='/self/proc/cwd' -S b.cpp -o b.s
281 .globl main # -- Begin function main
290 .cfi_def_cfa_offset 16
293 .cfi_def_cfa_register r31
301 .size main, .Lfunc_end0-.Lfunc_begin0
304 .section .debug_abbrev,"",@progbits
308 .section .debug_info,"",@progbits
310 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
312 .short 5 # DWARF version number
313 .byte 1 # DWARF Unit Type
314 .byte 4 # Address Size (in bytes)
315 .long .debug_abbrev # Offset Into Abbrev. Section
317 .section .debug_str_offsets,"",@progbits
318 .long 32 # Length of String Offsets Set
322 .section .debug_str,"MS",@progbits,1
324 .asciz "clang version 19.0.0git (git@github.com:llvm/llvm-project.git 53b14cd9ce2b57da73d173fc876d2e9e199f5640)" # string offset=0
326 .asciz "b.cpp" # string offset=104
328 .asciz "/proc/self/cwd" # string offset=110
330 .asciz "main" # string offset=125
332 .asciz "int" # string offset=130
334 .asciz "v1" # string offset=134
336 .asciz "t1" # string offset=137
340 .section .debug_names,"",@progbits
341 .long .Lnames_end0-.Lnames_start0 # Header: unit length
343 .short 5 # Header: version
344 .short 0 # Header: padding
345 .long 1 # Header: compilation unit count
346 .long 0 # Header: local type unit count
347 .long 0 # Header: foreign type unit count
348 .long 3 # Header: bucket count
349 .long 3 # Header: name count
350 .long .Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size
351 .long 8 # Header: augmentation string size
352 .ascii "LLVM0700" # Header: augmentation string
353 .long .Lcu_begin0 # Compilation unit 0
357 .long 5863786 # Hash in Bucket 1
358 .long 2090499946 # Hash in Bucket 1
359 .long 193495088 # Hash in Bucket 2
360 .long .Linfo_string6 # String in Bucket 1: t1
361 .long .Linfo_string3 # String in Bucket 1: main
362 .long .Linfo_string4 # String in Bucket 2: int
363 .long .Lnames2-.Lnames_entries0 # Offset in Bucket 1
364 .long .Lnames0-.Lnames_entries0 # Offset in Bucket 1
365 .long .Lnames1-.Lnames_entries0 # Offset in Bucket 2
366 .Lnames_abbrev_start0:
367 .byte 1 # Abbrev code
368 .byte 19 # DW_TAG_structure_type
369 .byte 3 # DW_IDX_die_offset
370 .byte 19 # DW_FORM_ref4
371 .byte 4 # DW_IDX_parent
372 .byte 25 # DW_FORM_flag_present
373 .byte 0 # End of abbrev
374 .byte 0 # End of abbrev
375 .byte 2 # Abbrev code
376 .byte 46 # DW_TAG_subprogram
377 .byte 3 # DW_IDX_die_offset
378 .byte 19 # DW_FORM_ref4
379 .byte 4 # DW_IDX_parent
380 .byte 25 # DW_FORM_flag_present
381 .byte 0 # End of abbrev
382 .byte 0 # End of abbrev
383 .byte 3 # Abbrev code
384 .byte 36 # DW_TAG_base_type
385 .byte 3 # DW_IDX_die_offset
386 .byte 19 # DW_FORM_ref4
387 .byte 4 # DW_IDX_parent
388 .byte 25 # DW_FORM_flag_present
389 .byte 0 # End of abbrev
390 .byte 0 # End of abbrev
391 .byte 0 # End of abbrev list
396 .byte 1 # Abbreviation code
397 .long 66 # DW_IDX_die_offset
398 .byte 0 # DW_IDX_parent
402 .byte 2 # Abbreviation code
403 .long 35 # DW_IDX_die_offset
404 .byte 0 # DW_IDX_parent
408 .byte 3 # Abbreviation code
409 .long 62 # DW_IDX_die_offset
410 .byte 0 # DW_IDX_parent
414 .ident "clang version 19.0.0git (git@github.com:llvm/llvm-project.git 53b14cd9ce2b57da73d173fc876d2e9e199f5640)"
415 .section ".note.GNU-stack","",@progbits
417 .section .debug_line,"",@progbits