1# REQUIRES: x86
2# RUN: yaml2obj %s -o %t.o
3# RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck %s
4
5# The debug info has a broken relocation. Check that we don't crash
6# and still report the undefined symbol.
7
8# CHECK: error: {{.*}}.o: relocation R_X86_64_64 at 0x29 has unsupported target
9# CHECK: error: undefined symbol: bar
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      - Offset:          0x0000000000000000
29        Symbol:          bar
30        Type:            R_X86_64_64
31  - Name:            .debug_line
32    Type:            SHT_PROGBITS
33    Content:         3300000002001C0000000101FB0E0D000101010100000001000001006162632E7300000000000009020000000000000000140208000101
34  - Name:            .rela.debug_line
35    AddressAlign:    8
36    Type:            SHT_RELA
37    Link:            .symtab
38    Info:            .debug_line
39    Relocations:
40      - Offset:          0x0000000000000029
41        Symbol:          bar
42        Type:            R_X86_64_64
43  - Name:            .debug_info
44    Type:            SHT_PROGBITS
45    AddressAlign:    0x0000000000000001
46    Content:         0C000000040000000000080100000000
47  - Name:            .rela.debug_info
48    Type:            SHT_RELA
49    Link:            .symtab
50    AddressAlign:    0x0000000000000008
51    Info:            .debug_info
52    Relocations:
53      - Offset:          0x0000000000000006
54        Symbol:          .debug_abbrev
55        Type:            R_X86_64_32
56      - Offset:          0x000000000000000C
57        Symbol:          .debug_line
58        Type:            R_X86_64_32
59  - Name:            .debug_abbrev
60    Type:            SHT_PROGBITS
61    AddressAlign:    0x0000000000000001
62    Content:         '0111001017000000'
63
64Symbols:
65  Global:
66    - Name:            _start
67      Section:         .text
68    - Name:            bar
69