2 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux -o %t %s
3 # RUN: ld.lld --gdb-index --gc-sections -o %t2 %t
4 # RUN: llvm-dwarfdump -gdb-index %t2 | FileCheck %s
6 # CHECK: Address area offset = 0x28, has 1 entries:
7 # CHECK-NEXT: Low/High address = [0x201150, 0x201151) (Size: 0x1), CU id = 0
9 # Generated with: (clang r302976)
10 # echo "void _start() {} void dead() {}" | \
11 # clang -Os -g -S -ffunction-sections -o gdb-index-gc-sections.s -x c - -Xclang -fdebug-compilation-dir -Xclang .
15 .section .text._start,"ax",@progbits
17 .type _start,@function
21 .loc 1 1 0 # <stdin>:1:0
24 .loc 1 1 16 prologue_end # <stdin>:1:16
28 .size _start, .Lfunc_end0-_start
31 .section .text.dead,"ax",@progbits
36 .loc 1 1 0 # <stdin>:1:0
39 .loc 1 1 31 prologue_end # <stdin>:1:31
43 .size dead, .Lfunc_end1-dead
46 .section .debug_str,"MS",@progbits,1
48 .asciz "clang version 5.0.0 " # string offset=0
50 .asciz "-" # string offset=21
52 .asciz "." # string offset=23
54 .asciz "_start" # string offset=25
56 .asciz "dead" # string offset=32
57 .section .debug_loc,"",@progbits
58 .section .debug_abbrev,"",@progbits
59 .byte 1 # Abbreviation Code
60 .byte 17 # DW_TAG_compile_unit
61 .byte 1 # DW_CHILDREN_yes
62 .byte 37 # DW_AT_producer
63 .byte 14 # DW_FORM_strp
64 .byte 19 # DW_AT_language
65 .byte 5 # DW_FORM_data2
67 .byte 14 # DW_FORM_strp
68 .byte 16 # DW_AT_stmt_list
69 .byte 23 # DW_FORM_sec_offset
70 .byte 27 # DW_AT_comp_dir
71 .byte 14 # DW_FORM_strp
72 .byte 17 # DW_AT_low_pc
73 .byte 1 # DW_FORM_addr
74 .byte 85 # DW_AT_ranges
75 .byte 23 # DW_FORM_sec_offset
78 .byte 2 # Abbreviation Code
79 .byte 46 # DW_TAG_subprogram
80 .byte 0 # DW_CHILDREN_no
81 .byte 17 # DW_AT_low_pc
82 .byte 1 # DW_FORM_addr
83 .byte 18 # DW_AT_high_pc
84 .byte 6 # DW_FORM_data4
85 .byte 64 # DW_AT_frame_base
86 .byte 24 # DW_FORM_exprloc
88 .byte 14 # DW_FORM_strp
89 .byte 58 # DW_AT_decl_file
90 .byte 11 # DW_FORM_data1
91 .byte 59 # DW_AT_decl_line
92 .byte 11 # DW_FORM_data1
93 .byte 63 # DW_AT_external
94 .byte 25 # DW_FORM_flag_present
98 .section .debug_info,"",@progbits
100 .long 81 # Length of Unit
101 .short 4 # DWARF version number
102 .long .debug_abbrev # Offset Into Abbrev. Section
103 .byte 8 # Address Size (in bytes)
104 .byte 1 # Abbrev [1] 0xb:0x4a DW_TAG_compile_unit
105 .long .Linfo_string0 # DW_AT_producer
106 .short 12 # DW_AT_language
107 .long .Linfo_string1 # DW_AT_name
108 .long .Lline_table_start0 # DW_AT_stmt_list
109 .long .Linfo_string2 # DW_AT_comp_dir
110 .quad 0 # DW_AT_low_pc
111 .long .Ldebug_ranges0 # DW_AT_ranges
112 .byte 2 # Abbrev [2] 0x2a:0x15 DW_TAG_subprogram
113 .quad .Lfunc_begin0 # DW_AT_low_pc
114 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
115 .byte 1 # DW_AT_frame_base
117 .long .Linfo_string3 # DW_AT_name
118 .byte 1 # DW_AT_decl_file
119 .byte 1 # DW_AT_decl_line
121 .byte 2 # Abbrev [2] 0x3f:0x15 DW_TAG_subprogram
122 .quad .Lfunc_begin1 # DW_AT_low_pc
123 .long .Lfunc_end1-.Lfunc_begin1 # DW_AT_high_pc
124 .byte 1 # DW_AT_frame_base
126 .long .Linfo_string4 # DW_AT_name
127 .byte 1 # DW_AT_decl_file
128 .byte 1 # DW_AT_decl_line
130 .byte 0 # End Of Children Mark
131 .section .debug_ranges,"",@progbits
139 .section .debug_macinfo,"",@progbits
141 .byte 0 # End Of Macro List Mark
142 .section .debug_pubnames,"",@progbits
143 .long .LpubNames_end0-.LpubNames_begin0 # Length of Public Names Info
145 .short 2 # DWARF Version
146 .long .Lcu_begin0 # Offset of Compilation Unit Info
147 .long 85 # Compilation Unit Length
148 .long 42 # DIE offset
149 .asciz "_start" # External Name
150 .long 63 # DIE offset
151 .asciz "dead" # External Name
155 .ident "clang version 5.0.0 "
156 .section ".note.GNU-stack","",@progbits
157 .section .debug_line,"",@progbits