1# REQUIRES: x86
2# RUN: yaml2obj %s -o %t.o
3# RUN: not ld.lld %t.o -o /dev/null
4
5# The debug info has a broken relocation. Check that we don't crash.
6
7# We used to dereference null Target in DWARF.cpp:findAux while reporting a duplicate symbol error,
8# because Target wasn't initialized yet.
9# RUN: not ld.lld %t.o %t.o -o /dev/null
10
11--- !ELF
12FileHeader:
13  Class:           ELFCLASS64
14  Data:            ELFDATA2LSB
15  Type:            ET_REL
16  Machine:         EM_X86_64
17Sections:
18  - Name:            .text
19    Type:            SHT_PROGBITS
20    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
21    Content:         '0000000000000000'
22  - Name:            .rela.text
23    Type:            SHT_RELA
24    AddressAlign:    8
25    Link:            .symtab
26    Info:            .text
27    Relocations:
28      - Symbol:      bar
29        Type:        R_X86_64_64
30  - Name:            .debug_line
31    Type:            SHT_PROGBITS
32    Content:         3300000002001C0000000101FB0E0D000101010100000001000001006162632E7300000000000009020000000000000000140208000101
33  - Name:            .rela.debug_line
34    AddressAlign:    8
35    Type:            SHT_RELA
36    Link:            .symtab
37    Info:            .debug_line
38    Relocations:
39      - Offset:          0x0000000000000029
40        Symbol:          bar
41        Type:            R_X86_64_64
42  - Name:            .debug_info
43    Type:            SHT_PROGBITS
44    AddressAlign:    0x0000000000000001
45    Content:         0C000000040000000000080100000000
46  - Name:            .rela.debug_info
47    Type:            SHT_RELA
48    Link:            .symtab
49    AddressAlign:    0x0000000000000008
50    Info:            .debug_info
51    Relocations:
52      - Offset:          0x0000000000000006
53        Symbol:          .debug_abbrev
54        Type:            R_X86_64_32
55      - Offset:          0x000000000000000C
56        Symbol:          .debug_line
57        Type:            R_X86_64_32
58  - Name:            .debug_abbrev
59    Type:            SHT_PROGBITS
60    AddressAlign:    0x0000000000000001
61    Content:         '0111001017000000'
62
63Symbols:
64  - Name:            .debug_abbrev
65    Type:            STT_SECTION
66    Section:         .debug_abbrev
67  - Name:            .debug_line
68    Type:            STT_SECTION
69    Section:         .debug_line
70  - Name:            _start
71    Section:         .text
72    Binding:         STB_GLOBAL
73  - Name:            bar
74    Binding:         STB_GLOBAL
75