xref: /llvm-project/llvm/test/tools/llvm-objcopy/ELF/multiple-symtab.test (revision bc6e10c9efca78cda350b6705de27728d142c0b0)
1*bc6e10c9SMoshe Berman## According to the ELF gABI, "Currently, an object file may have only one
2*bc6e10c9SMoshe Berman## section of each type [SHT_SYMTAB and SHT_DYNSYM], but this restriction may be
3*bc6e10c9SMoshe Berman## relaxed in the future."
4*bc6e10c9SMoshe Berman## This test shows that we emit an error if we encounter multiple SHT_SYMTAB
5*bc6e10c9SMoshe Berman## sections.
6*bc6e10c9SMoshe Berman# RUN: yaml2obj %s -o %t
7*bc6e10c9SMoshe Berman# RUN: not llvm-objcopy %t /dev/null 2>&1 | FileCheck %s
8*bc6e10c9SMoshe Berman
9*bc6e10c9SMoshe Berman# CHECK: error: found multiple SHT_SYMTAB sections
10*bc6e10c9SMoshe Berman
11*bc6e10c9SMoshe Berman--- !ELF
12*bc6e10c9SMoshe BermanFileHeader:
13*bc6e10c9SMoshe Berman  Class:   ELFCLASS64
14*bc6e10c9SMoshe Berman  Data:    ELFDATA2LSB
15*bc6e10c9SMoshe Berman  Type:    ET_REL
16*bc6e10c9SMoshe BermanSections:
17*bc6e10c9SMoshe Berman  - Name: .symtab
18*bc6e10c9SMoshe Berman    Type: SHT_SYMTAB
19*bc6e10c9SMoshe Berman  - Name: .symtab2
20*bc6e10c9SMoshe Berman    Type: SHT_SYMTAB
21