159 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux -o %t %s3# RUN: ld.lld --gdb-index --gc-sections -o %t2 %t4# RUN: llvm-dwarfdump -gdb-index %t2 | FileCheck %s5 6# CHECK: Address area offset = 0x28, has 1 entries:7# CHECK-NEXT: Low/High address = [0x201150, 0x201151) (Size: 0x1), CU id = 08 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 .12 13 .text14 .file "-"15 .section .text._start,"ax",@progbits16 .globl _start17 .type _start,@function18_start: # @_start19.Lfunc_begin0:20 .file 1 "<stdin>"21 .loc 1 1 0 # <stdin>:1:022 .cfi_startproc23# BB#0: # %entry24 .loc 1 1 16 prologue_end # <stdin>:1:1625 retq26.Ltmp0:27.Lfunc_end0:28 .size _start, .Lfunc_end0-_start29 .cfi_endproc30 31 .section .text.dead,"ax",@progbits32 .globl dead33 .type dead,@function34dead: # @dead35.Lfunc_begin1:36 .loc 1 1 0 # <stdin>:1:037 .cfi_startproc38# BB#0: # %entry39 .loc 1 1 31 prologue_end # <stdin>:1:3140 retq41.Ltmp1:42.Lfunc_end1:43 .size dead, .Lfunc_end1-dead44 .cfi_endproc45 46 .section .debug_str,"MS",@progbits,147.Linfo_string0:48 .asciz "clang version 5.0.0 " # string offset=049.Linfo_string1:50 .asciz "-" # string offset=2151.Linfo_string2:52 .asciz "." # string offset=2353.Linfo_string3:54 .asciz "_start" # string offset=2555.Linfo_string4:56 .asciz "dead" # string offset=3257 .section .debug_loc,"",@progbits58 .section .debug_abbrev,"",@progbits59 .byte 1 # Abbreviation Code60 .byte 17 # DW_TAG_compile_unit61 .byte 1 # DW_CHILDREN_yes62 .byte 37 # DW_AT_producer63 .byte 14 # DW_FORM_strp64 .byte 19 # DW_AT_language65 .byte 5 # DW_FORM_data266 .byte 3 # DW_AT_name67 .byte 14 # DW_FORM_strp68 .byte 16 # DW_AT_stmt_list69 .byte 23 # DW_FORM_sec_offset70 .byte 27 # DW_AT_comp_dir71 .byte 14 # DW_FORM_strp72 .byte 17 # DW_AT_low_pc73 .byte 1 # DW_FORM_addr74 .byte 85 # DW_AT_ranges75 .byte 23 # DW_FORM_sec_offset76 .byte 0 # EOM(1)77 .byte 0 # EOM(2)78 .byte 2 # Abbreviation Code79 .byte 46 # DW_TAG_subprogram80 .byte 0 # DW_CHILDREN_no81 .byte 17 # DW_AT_low_pc82 .byte 1 # DW_FORM_addr83 .byte 18 # DW_AT_high_pc84 .byte 6 # DW_FORM_data485 .byte 64 # DW_AT_frame_base86 .byte 24 # DW_FORM_exprloc87 .byte 3 # DW_AT_name88 .byte 14 # DW_FORM_strp89 .byte 58 # DW_AT_decl_file90 .byte 11 # DW_FORM_data191 .byte 59 # DW_AT_decl_line92 .byte 11 # DW_FORM_data193 .byte 63 # DW_AT_external94 .byte 25 # DW_FORM_flag_present95 .byte 0 # EOM(1)96 .byte 0 # EOM(2)97 .byte 0 # EOM(3)98 .section .debug_info,"",@progbits99.Lcu_begin0:100 .long 81 # Length of Unit101 .short 4 # DWARF version number102 .long .debug_abbrev # Offset Into Abbrev. Section103 .byte 8 # Address Size (in bytes)104 .byte 1 # Abbrev [1] 0xb:0x4a DW_TAG_compile_unit105 .long .Linfo_string0 # DW_AT_producer106 .short 12 # DW_AT_language107 .long .Linfo_string1 # DW_AT_name108 .long .Lline_table_start0 # DW_AT_stmt_list109 .long .Linfo_string2 # DW_AT_comp_dir110 .quad 0 # DW_AT_low_pc111 .long .Ldebug_ranges0 # DW_AT_ranges112 .byte 2 # Abbrev [2] 0x2a:0x15 DW_TAG_subprogram113 .quad .Lfunc_begin0 # DW_AT_low_pc114 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc115 .byte 1 # DW_AT_frame_base116 .byte 87117 .long .Linfo_string3 # DW_AT_name118 .byte 1 # DW_AT_decl_file119 .byte 1 # DW_AT_decl_line120 # DW_AT_external121 .byte 2 # Abbrev [2] 0x3f:0x15 DW_TAG_subprogram122 .quad .Lfunc_begin1 # DW_AT_low_pc123 .long .Lfunc_end1-.Lfunc_begin1 # DW_AT_high_pc124 .byte 1 # DW_AT_frame_base125 .byte 87126 .long .Linfo_string4 # DW_AT_name127 .byte 1 # DW_AT_decl_file128 .byte 1 # DW_AT_decl_line129 # DW_AT_external130 .byte 0 # End Of Children Mark131 .section .debug_ranges,"",@progbits132.Ldebug_ranges0:133 .quad .Lfunc_begin0134 .quad .Lfunc_end0135 .quad .Lfunc_begin1136 .quad .Lfunc_end1137 .quad 0138 .quad 0139 .section .debug_macinfo,"",@progbits140.Lcu_macro_begin0:141 .byte 0 # End Of Macro List Mark142 .section .debug_pubnames,"",@progbits143 .long .LpubNames_end0-.LpubNames_begin0 # Length of Public Names Info144.LpubNames_begin0:145 .short 2 # DWARF Version146 .long .Lcu_begin0 # Offset of Compilation Unit Info147 .long 85 # Compilation Unit Length148 .long 42 # DIE offset149 .asciz "_start" # External Name150 .long 63 # DIE offset151 .asciz "dead" # External Name152 .long 0 # End Mark153.LpubNames_end0:154 155 .ident "clang version 5.0.0 "156 .section ".note.GNU-stack","",@progbits157 .section .debug_line,"",@progbits158.Lline_table_start0:159