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## Previously we would report an error saying the relocation in .debug_info
6## has an unsupported target.
7## Check we do not report debug information parsing errors when relocation
8## used is of type R_*_NONE, what actually means it should be ignored.
9
10# CHECK-NOT: error
11# CHECK: error: undefined symbol: bar
12# CHECK-NOT: error
13
14--- !ELF
15FileHeader:
16  Class:           ELFCLASS64
17  Data:            ELFDATA2LSB
18  Type:            ET_REL
19  Machine:         EM_X86_64
20Sections:
21  - Name:            .text
22    Type:            SHT_PROGBITS
23    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
24    Content:         '0000000000000000'
25  - Name:            .rela.text
26    Type:            SHT_RELA
27    AddressAlign:    8
28    Link:            .symtab
29    Info:            .text
30    Relocations:
31      - Symbol:          bar
32        Type:            R_X86_64_64
33  - Name:            .debug_line
34    Type:            SHT_PROGBITS
35    Content:         3300000002001C0000000101FB0E0D000101010100000001000001006162632E7300000000000009020000000000000000140208000101
36  - Name:            .rela.debug_line
37    AddressAlign:    8
38    Type:            SHT_RELA
39    Link:            .symtab
40    Info:            .debug_line
41    Relocations:
42      - Offset:          0x0000000000000029
43        Type:            R_X86_64_NONE
44  - Name:            .debug_info
45    Type:            SHT_PROGBITS
46    AddressAlign:    0x0000000000000001
47    Content:         0C000000040000000000080100000000
48  - Name:            .debug_abbrev
49    Type:            SHT_PROGBITS
50    AddressAlign:    0x0000000000000001
51    Content:         '0111001017000000'
52
53Symbols:
54  - Name:            _start
55    Section:         .text
56    Binding:         STB_GLOBAL
57  - Name:            bar
58    Binding:         STB_GLOBAL
59