1 # Test objective to verify warning is printed if DWO secton has relocations.
3 # RUN: llvm-mc -triple x86_64-unknown-linux %s -filetype=obj -o %t.o
4 # RUN: llvm-dwarfdump --debug-info %t.o | FileCheck %s
5 # RUN: llvm-dwarfdump --debug-info %t.o 2> %t.txt
6 # RUN: FileCheck --input-file=%t.txt %s --check-prefix=PART2 --implicit-check-not=warning:
8 .section .debug_str.dwo,"MSe",@progbits,1
10 .asciz "Handmade DWO producer"
12 .asciz "V5_dwo_compile_unit"
14 .section .debug_str_offsets.dwo,"e",@progbits
15 .long Lstr_offsets_end-Lstr_offsets_start # Length of String Offsets Set
19 .long .dwo_producer-.debug_str.dwo
20 .long .dwo_CU_5-.debug_str.dwo
23 # And a .dwo copy for the .dwo sections.
24 .section .debug_abbrev.dwo,"e",@progbits
25 .byte 0x01 # Abbrev code
26 .byte 0x11 # DW_TAG_compile_unit
27 .byte 0x00 # DW_CHILDREN_no
28 .byte 0x25 # DW_AT_producer
29 .byte 0x0e # DW_FORM_strp
30 .byte 0x03 # DW_AT_name
31 .byte 0x25 # DW_FORM_strx1
36 # PART2: warning: unexpected relocations for dwo section '.debug_abbrev.dwo'
37 .reloc ., R_X86_64_NONE, 0
39 .section .debug_info.dwo,"e",@progbits
40 # CHECK-LABEL: .debug_info.dwo
42 # DWARF v5 split CU header.
43 .long CU_split_5_end-CU_split_5_version # Length of Unit
45 .short 5 # DWARF version number
46 .byte 5 # DWARF Unit Type
47 .byte 8 # Address Size (in bytes)
48 .long 0 # Offset Into Abbrev. Section
50 # The split compile-unit DIE, with DW_AT_producer, DW_AT_name, DW_AT_stmt_list.
57 # CHECK: 0x00000000: Compile Unit: length = 0x00000017, format = DWARF32, version = 0x0005, unit_type = DW_UT_split_compile, abbr_offset = 0x0000, addr_size = 0x08, DWO_id = 0x000000000000005a (next unit at 0x0000001b)
58 # CHECK: 0x00000014: DW_TAG_compile_unit
59 # CHECK-NEXT: DW_AT_producer ("Handmade DWO producer")
60 # CHECK-NEXT: DW_AT_name ("V5_dwo_compile_unit")
61 # PART2: warning: unexpected relocations for dwo section '.debug_info.dwo'
63 ## No warning, even if their names end with ".dwo".
64 .section .rodata.dwo,"a"