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