xref: /llvm-project/lld/test/ELF/invalid/multiple-relocations-sections.test (revision 288082d45d6124a7f818f6a44feec7780fbc4c52)
1# RUN: yaml2obj %s -o %t1.o
2# RUN: not ld.lld %t1.o -o /dev/null 2>&1 | FileCheck %s
3# CHECK: error: {{.*}}1.o:(.text): multiple relocation sections to one section are not supported
4
5## The file has two relocation sections referring to a single target section.
6## Multiple relocation sections to one section are not supported, check we report this case.
7
8--- !ELF
9FileHeader:
10  Class:     ELFCLASS64
11  Data:      ELFDATA2LSB
12  Type:      ET_REL
13  Machine:   EM_X86_64
14Sections:
15  - Name:    .text
16    Type:    SHT_PROGBITS
17    Flags:   [ SHF_ALLOC, SHF_EXECINSTR ]
18  - Name:    .rela.text1
19    Type:    SHT_RELA
20    Link:    .symtab
21    Info:    .text
22  - Name:    .rela.text2
23    Type:    SHT_RELA
24    Link:    .symtab
25    Info:    .text
26Symbols:
27  - Name:    .text
28    Type:    STT_SECTION
29    Section: .text
30