93 lines · plain
1# RUN: llvm-mc -triple x86_64-unknown-linux %s -filetype=obj -o %t.o2# RUN: not llvm-dwarfdump -v %t.o 2>&1 | FileCheck --check-prefix=OVERLAP %s3#4# Test object to verify that llvm-dwarfdump handles an invalid string offsets5# table with overlapping contributions.6 7 .section .debug_str,"MS",@progbits,18str_producer:9 .asciz "Handmade DWARF producer"10str_CU1:11 .asciz "Compile_Unit_1"12str_CU1_dir:13 .asciz "/home/test/CU1"14str_CU2:15 .asciz "Compile_Unit_2"16str_CU2_dir:17 .asciz "/home/test/CU2"18str_TU:19 .asciz "Type_Unit"20str_TU_type:21 .asciz "MyStruct"22 23 .section .debug_str.dwo,"MSe",@progbits,124dwo_str_CU_5_producer:25 .asciz "Handmade split DWARF producer"26dwo_str_CU_5_name:27 .asciz "V5_split_compile_unit"28dwo_str_CU_5_comp_dir:29 .asciz "/home/test/splitCU"30dwo_str_TU_5:31 .asciz "V5_split_type_unit"32dwo_str_TU_5_type:33 .asciz "V5_split_Mystruct"34 35# A rudimentary abbrev section.36 .section .debug_abbrev,"",@progbits37 .byte 0x01 # Abbrev code38 .byte 0x11 # DW_TAG_compile_unit39 .byte 0x00 # DW_CHILDREN_no40 .byte 0x72 # DW_AT_str_offsets_base41 .byte 0x17 # DW_FORM_sec_offset42 .byte 0x00 # EOM(1)43 .byte 0x00 # EOM(2)44 .byte 0x00 # EOM(3)45 46 .section .debug_info,"",@progbits47# DWARF v5 CU header.48 .long CU1_5_end-CU1_5_version # Length of Unit49CU1_5_version:50 .short 5 # DWARF version number51 .byte 1 # DWARF Unit Type52 .byte 8 # Address Size (in bytes)53 .long .debug_abbrev # Offset Into Abbrev. Section54# A compile-unit DIE, which has no attributes.55 .byte 1 # Abbreviation code56 .long .debug_str_offsets_base057CU1_5_end:58 59# DWARF v5 CU header.60 .long CU2_5_end-CU2_5_version # Length of Unit61CU2_5_version:62 .short 5 # DWARF version number63 .byte 1 # DWARF Unit Type64 .byte 8 # Address Size (in bytes)65 .long .debug_abbrev # Offset Into Abbrev. Section66# A compile-unit DIE, which has no attributes.67 .byte 1 # Abbreviation code68 .long .debug_str_offsets_base169CU2_5_end:70 71 .section .debug_str_offsets,"",@progbits72# CU1's contribution73 .long .debug_str_offsets_segment1_end-.debug_str_offsets_base0+474 .short 5 # DWARF version75 .short 0 # Padding76.debug_str_offsets_base0:77 .long str_producer78 .long str_CU179 .long str_CU1_dir80.debug_str_offsets_segment0_end:81# CU2's contribution82# Overlapping with CU1's contribution83 .long .debug_str_offsets_segment1_end-.debug_str_offsets_base1+484 .short 5 # DWARF version85 .short 0 # Padding86.debug_str_offsets_base1:87 .long str_producer88 .long str_CU289 .long str_CU2_dir90.debug_str_offsets_segment1_end:91 92# OVERLAP: error: overlapping contributions to string offsets table in section .debug_str_offsets.93