141 lines · yaml
1# RUN: yaml2obj %s -o %t.o2# RUN: ld.lld --gdb-index %t.o -o /dev/null3 4## We used to crash if a DWARFAddressRange has invalid SectionIndex (-1).5## Such DWARFAddressRange can be produced by clang -c -gdwarf-5 -gmlt before r360678.6 7--- !ELF8FileHeader:9 Class: ELFCLASS6410 Data: ELFDATA2LSB11 Type: ET_REL12 Machine: EM_X86_6413Sections:14 - Name: .text15 Type: SHT_PROGBITS16 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]17 AddressAlign: 0x000000000000001018 Content: 31C0C319 - Name: .debug_str_offsets20 Type: SHT_PROGBITS21 AddressAlign: 0x000000000000000122 Content: '1000000005000000000000000000000000000000'23 - Name: .rela.debug_str_offsets24 Type: SHT_RELA25 Link: .symtab26 AddressAlign: 0x000000000000000827 EntSize: 0x000000000000001828 Info: .debug_str_offsets29 Relocations:30 - Offset: 0x000000000000000831 Symbol: .debug_str32 Type: R_X86_64_3233 - Offset: 0x000000000000000C34 Symbol: .debug_str35 Type: R_X86_64_3236 Addend: 137 - Offset: 0x000000000000001038 Symbol: .debug_str39 Type: R_X86_64_3240 Addend: 641 - Name: .debug_str42 Type: SHT_PROGBITS43 Flags: [ SHF_MERGE, SHF_STRINGS ]44 AddressAlign: 0x000000000000000145 EntSize: 0x000000000000000146 Content: 00612E6363002F746D700047 - Name: .debug_abbrev48 Type: SHT_PROGBITS49 AddressAlign: 0x000000000000000150 Content: 011100252513050325721710171B25111B120600000051 - Name: .debug_info52 Type: SHT_PROGBITS53 AddressAlign: 0x000000000000000154 Content: 1B00000005000108000000000100040001000000000000000002000300000055 - Name: .rela.debug_info56 Type: SHT_RELA57 Link: .symtab58 AddressAlign: 0x000000000000000859 EntSize: 0x000000000000001860 Info: .debug_info61 Relocations:62 - Offset: 0x000000000000000863 Symbol: .debug_abbrev64 Type: R_X86_64_3265 - Offset: 0x000000000000001166 Symbol: .debug_str_offsets67 Type: R_X86_64_3268 Addend: 869 - Offset: 0x000000000000001570 Symbol: .debug_line71 Type: R_X86_64_3272 - Name: .debug_addr73 Type: SHT_PROGBITS74 AddressAlign: 0x000000000000000175 Content: 0C00000005000800000000000000000076 - Name: .rela.debug_addr77 Type: SHT_RELA78 Link: .symtab79 AddressAlign: 0x000000000000000880 EntSize: 0x000000000000001881 Info: .debug_addr82 Relocations:83 - Offset: 0x000000000000000884 Symbol: .text85 Type: R_X86_64_6486 - Name: .debug_line87 Type: SHT_PROGBITS88 AddressAlign: 0x000000000000000189 Content: 2D0000000500080025000000010101FB0E0D00010101010000000100000101011F010000000002011F020F01000000000090 - Name: .rela.debug_line91 Type: SHT_RELA92 Link: .symtab93 AddressAlign: 0x000000000000000894 EntSize: 0x000000000000001895 Info: .debug_line96 Relocations:97 - Offset: 0x000000000000002298 Symbol: .debug_line_str99 Type: R_X86_64_32100 - Offset: 0x000000000000002C101 Symbol: .debug_line_str102 Type: R_X86_64_32103 Addend: 5104 - Name: .debug_line_str105 Type: SHT_PROGBITS106 Flags: [ SHF_MERGE, SHF_STRINGS ]107 AddressAlign: 0x0000000000000001108 EntSize: 0x0000000000000001109 Content: 2F746D7000612E636300110Symbols:111 - Name: a.ll112 Type: STT_FILE113 Index: SHN_ABS114 - Name: .text115 Type: STT_SECTION116 Section: .text117 - Name: .debug_str_offsets118 Type: STT_SECTION119 Section: .debug_str_offsets120 - Name: .debug_str121 Type: STT_SECTION122 Section: .debug_str123 - Name: .debug_abbrev124 Type: STT_SECTION125 Section: .debug_abbrev126 - Name: .debug_info127 Type: STT_SECTION128 Section: .debug_info129 - Name: .debug_line130 Type: STT_SECTION131 Section: .debug_line132 - Name: .debug_line_str133 Type: STT_SECTION134 Section: .debug_line_str135 - Name: foo136 Type: STT_FUNC137 Section: .text138 Binding: STB_GLOBAL139 Size: 0x0000000000000003140...141