1# int foo() { return 0; } 2# int main() { return foo(); } 3# clang++ -ffunction-sections -g2 -gdwarf-4 -gsplit-dwarf -S main.cpp 4 5.text 6 .file "main.cpp" 7 .globl _Z3foov # -- Begin function _Z3foov 8 .p2align 4, 0x90 9 .type _Z3foov,@function 10_Z3foov: # @_Z3foov 11.Lfunc_begin0: 12 .file 1 "." "main.cpp" 13 .loc 1 1 0 # main.cpp:1:0 14 .cfi_startproc 15# %bb.0: # %entry 16 pushq %rbp 17 .cfi_def_cfa_offset 16 18 .cfi_offset %rbp, -16 19 movq %rsp, %rbp 20 .cfi_def_cfa_register %rbp 21.Ltmp0: 22 .loc 1 1 13 prologue_end # main.cpp:1:13 23 xorl %eax, %eax 24 .loc 1 1 13 epilogue_begin is_stmt 0 # main.cpp:1:13 25 popq %rbp 26 .cfi_def_cfa %rsp, 8 27 retq 28.Ltmp1: 29.Lfunc_end0: 30 .size _Z3foov, .Lfunc_end0-_Z3foov 31 .cfi_endproc 32 # -- End function 33 .globl main # -- Begin function main 34 .p2align 4, 0x90 35 .type main,@function 36main: # @main 37.Lfunc_begin1: 38 .loc 1 2 0 is_stmt 1 # main.cpp:2:0 39 .cfi_startproc 40# %bb.0: # %entry 41 pushq %rbp 42 .cfi_def_cfa_offset 16 43 .cfi_offset %rbp, -16 44 movq %rsp, %rbp 45 .cfi_def_cfa_register %rbp 46 subq $16, %rsp 47 movl $0, -4(%rbp) 48.Ltmp2: 49 .loc 1 2 21 prologue_end # main.cpp:2:21 50 callq _Z3foov 51 .loc 1 2 14 epilogue_begin is_stmt 0 # main.cpp:2:14 52 addq $16, %rsp 53 popq %rbp 54 .cfi_def_cfa %rsp, 8 55 retq 56.Ltmp3: 57.Lfunc_end1: 58 .size main, .Lfunc_end1-main 59 .cfi_endproc 60 # -- End function 61 .section .debug_abbrev,"",@progbits 62 .byte 1 # Abbreviation Code 63 .byte 17 # DW_TAG_compile_unit 64 .byte 0 # DW_CHILDREN_no 65 .byte 16 # DW_AT_stmt_list 66 .byte 23 # DW_FORM_sec_offset 67 .byte 27 # DW_AT_comp_dir 68 .byte 14 # DW_FORM_strp 69 .ascii "\264B" # DW_AT_GNU_pubnames 70 .byte 25 # DW_FORM_flag_present 71 .ascii "\260B" # DW_AT_GNU_dwo_name 72 .byte 14 # DW_FORM_strp 73 .ascii "\261B" # DW_AT_GNU_dwo_id 74 .byte 7 # DW_FORM_data8 75 .byte 17 # DW_AT_low_pc 76 .byte 1 # DW_FORM_addr 77 .byte 18 # DW_AT_high_pc 78 .byte 6 # DW_FORM_data4 79 .ascii "\263B" # DW_AT_GNU_addr_base 80 .byte 23 # DW_FORM_sec_offset 81 .byte 0 # EOM(1) 82 .byte 0 # EOM(2) 83 .byte 0 # EOM(3) 84 .section .debug_info,"",@progbits 85.Lcu_begin0: 86 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit 87.Ldebug_info_start0: 88 .short 4 # DWARF version number 89 .long .debug_abbrev # Offset Into Abbrev. Section 90 .byte 8 # Address Size (in bytes) 91 .byte 1 # Abbrev [1] 0xb:0x25 DW_TAG_compile_unit 92 .long .Lline_table_start0 # DW_AT_stmt_list 93 .long .Lskel_string0 # DW_AT_comp_dir 94 # DW_AT_GNU_pubnames 95 .long .Lskel_string1 # DW_AT_GNU_dwo_name 96 .quad -252790171939032967 # DW_AT_GNU_dwo_id 97 .quad .Lfunc_begin0 # DW_AT_low_pc 98 .long .Lfunc_end1-.Lfunc_begin0 # DW_AT_high_pc 99 .long .Laddr_table_base0 # DW_AT_GNU_addr_base 100.Ldebug_info_end0: 101 .section .debug_str,"MS",@progbits,1 102.Lskel_string0: 103 .asciz "." # string offset=0 104.Lskel_string1: 105 .asciz "main.dwo" # string offset=59 106 .section .debug_str.dwo,"eMS",@progbits,1 107.Linfo_string0: 108 .asciz "_Z3foov" # string offset=0 109.Linfo_string1: 110 .asciz "foo" # string offset=8 111.Linfo_string2: 112 .asciz "int" # string offset=12 113.Linfo_string3: 114 .asciz "main" # string offset=16 115.Linfo_string4: 116 .asciz "clang version 17.0.0 (https://github.com/llvm/llvm-project.git 640e07c49037cca41a1bfbeb916b569d8c950aea)" # string offset=21 117.Linfo_string5: 118 .asciz "main.cpp" # string offset=126 119.Linfo_string6: 120 .asciz "main.dwo" # string offset=135 121 .section .debug_str_offsets.dwo,"e",@progbits 122 .long 0 123 .long 8 124 .long 12 125 .long 16 126 .long 21 127 .long 126 128 .long 135 129 .section .debug_info.dwo,"e",@progbits 130 .long .Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit 131.Ldebug_info_dwo_start0: 132 .short 4 # DWARF version number 133 .long 0 # Offset Into Abbrev. Section 134 .byte 8 # Address Size (in bytes) 135 .byte 1 # Abbrev [1] 0xb:0x32 DW_TAG_compile_unit 136 .byte 4 # DW_AT_producer 137 .short 33 # DW_AT_language 138 .byte 5 # DW_AT_name 139 .byte 6 # DW_AT_GNU_dwo_name 140 .quad -252790171939032967 # DW_AT_GNU_dwo_id 141 .byte 2 # Abbrev [2] 0x19:0x10 DW_TAG_subprogram 142 .byte 0 # DW_AT_low_pc 143 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc 144 .byte 1 # DW_AT_frame_base 145 .byte 86 146 .byte 0 # DW_AT_linkage_name 147 .byte 1 # DW_AT_name 148 .byte 1 # DW_AT_decl_file 149 .byte 1 # DW_AT_decl_line 150 .long 56 # DW_AT_type 151 # DW_AT_external 152 .byte 3 # Abbrev [3] 0x29:0xf DW_TAG_subprogram 153 .byte 1 # DW_AT_low_pc 154 .long .Lfunc_end1-.Lfunc_begin1 # DW_AT_high_pc 155 .byte 1 # DW_AT_frame_base 156 .byte 86 157 .byte 3 # DW_AT_name 158 .byte 1 # DW_AT_decl_file 159 .byte 2 # DW_AT_decl_line 160 .long 56 # DW_AT_type 161 # DW_AT_external 162 .byte 4 # Abbrev [4] 0x38:0x4 DW_TAG_base_type 163 .byte 2 # DW_AT_name 164 .byte 5 # DW_AT_encoding 165 .byte 4 # DW_AT_byte_size 166 .byte 0 # End Of Children Mark 167.Ldebug_info_dwo_end0: 168 .section .debug_abbrev.dwo,"e",@progbits 169 .byte 1 # Abbreviation Code 170 .byte 17 # DW_TAG_compile_unit 171 .byte 1 # DW_CHILDREN_yes 172 .byte 37 # DW_AT_producer 173 .ascii "\202>" # DW_FORM_GNU_str_index 174 .byte 19 # DW_AT_language 175 .byte 5 # DW_FORM_data2 176 .byte 3 # DW_AT_name 177 .ascii "\202>" # DW_FORM_GNU_str_index 178 .ascii "\260B" # DW_AT_GNU_dwo_name 179 .ascii "\202>" # DW_FORM_GNU_str_index 180 .ascii "\261B" # DW_AT_GNU_dwo_id 181 .byte 7 # DW_FORM_data8 182 .byte 0 # EOM(1) 183 .byte 0 # EOM(2) 184 .byte 2 # Abbreviation Code 185 .byte 46 # DW_TAG_subprogram 186 .byte 0 # DW_CHILDREN_no 187 .byte 17 # DW_AT_low_pc 188 .ascii "\201>" # DW_FORM_GNU_addr_index 189 .byte 18 # DW_AT_high_pc 190 .byte 6 # DW_FORM_data4 191 .byte 64 # DW_AT_frame_base 192 .byte 24 # DW_FORM_exprloc 193 .byte 110 # DW_AT_linkage_name 194 .ascii "\202>" # DW_FORM_GNU_str_index 195 .byte 3 # DW_AT_name 196 .ascii "\202>" # DW_FORM_GNU_str_index 197 .byte 58 # DW_AT_decl_file 198 .byte 11 # DW_FORM_data1 199 .byte 59 # DW_AT_decl_line 200 .byte 11 # DW_FORM_data1 201 .byte 73 # DW_AT_type 202 .byte 19 # DW_FORM_ref4 203 .byte 63 # DW_AT_external 204 .byte 25 # DW_FORM_flag_present 205 .byte 0 # EOM(1) 206 .byte 0 # EOM(2) 207 .byte 3 # Abbreviation Code 208 .byte 46 # DW_TAG_subprogram 209 .byte 0 # DW_CHILDREN_no 210 .byte 17 # DW_AT_low_pc 211 .ascii "\201>" # DW_FORM_GNU_addr_index 212 .byte 18 # DW_AT_high_pc 213 .byte 6 # DW_FORM_data4 214 .byte 64 # DW_AT_frame_base 215 .byte 24 # DW_FORM_exprloc 216 .byte 3 # DW_AT_name 217 .ascii "\202>" # DW_FORM_GNU_str_index 218 .byte 58 # DW_AT_decl_file 219 .byte 11 # DW_FORM_data1 220 .byte 59 # DW_AT_decl_line 221 .byte 11 # DW_FORM_data1 222 .byte 73 # DW_AT_type 223 .byte 19 # DW_FORM_ref4 224 .byte 63 # DW_AT_external 225 .byte 25 # DW_FORM_flag_present 226 .byte 0 # EOM(1) 227 .byte 0 # EOM(2) 228 .byte 4 # Abbreviation Code 229 .byte 36 # DW_TAG_base_type 230 .byte 0 # DW_CHILDREN_no 231 .byte 3 # DW_AT_name 232 .ascii "\202>" # DW_FORM_GNU_str_index 233 .byte 62 # DW_AT_encoding 234 .byte 11 # DW_FORM_data1 235 .byte 11 # DW_AT_byte_size 236 .byte 11 # DW_FORM_data1 237 .byte 0 # EOM(1) 238 .byte 0 # EOM(2) 239 .byte 0 # EOM(3) 240 .section .debug_addr,"",@progbits 241.Laddr_table_base0: 242 .quad .Lfunc_begin0 243 .quad .Lfunc_begin1 244 .section .debug_gnu_pubnames,"",@progbits 245 .long .LpubNames_end0-.LpubNames_start0 # Length of Public Names Info 246.LpubNames_start0: 247 .short 2 # DWARF Version 248 .long .Lcu_begin0 # Offset of Compilation Unit Info 249 .long 48 # Compilation Unit Length 250 .long 41 # DIE offset 251 .byte 48 # Attributes: FUNCTION, EXTERNAL 252 .asciz "main" # External Name 253 .long 25 # DIE offset 254 .byte 48 # Attributes: FUNCTION, EXTERNAL 255 .asciz "foo" # External Name 256 .long 0 # End Mark 257.LpubNames_end0: 258 .section .debug_gnu_pubtypes,"",@progbits 259 .long .LpubTypes_end0-.LpubTypes_start0 # Length of Public Types Info 260.LpubTypes_start0: 261 .short 2 # DWARF Version 262 .long .Lcu_begin0 # Offset of Compilation Unit Info 263 .long 48 # Compilation Unit Length 264 .long 56 # DIE offset 265 .byte 144 # Attributes: TYPE, STATIC 266 .asciz "int" # External Name 267 .long 0 # End Mark 268.LpubTypes_end0: 269 .ident "clang version 17.0.0 (https://github.com/llvm/llvm-project.git 640e07c49037cca41a1bfbeb916b569d8c950aea)" 270 .section ".note.GNU-stack","",@progbits 271 .addrsig 272 .addrsig_sym _Z3foov 273 .section .debug_line,"",@progbits 274.Lline_table_start0: 275