Debian Codegraph @

llvm/test/tools/llvm-objcopy/ELF/symtab-error-on-remove-strtab.test

raw
1 # RUN: yaml2obj %s -o %t
2 # RUN: not llvm-objcopy -R .strtab %t %t2 2>&1 >/dev/null | FileCheck %s --check-prefix=ERR1 -DINPUT=%t
3 # RUN: cp %t %t3
4 # RUN: not llvm-strip --no-strip-all -R .strtab %t3 2>&1 >/dev/null | FileCheck %s --check-prefix=ERR2 -DINPUT=%t3
5
6 !ELF
7 FileHeader:
8 Class: ELFCLASS64
9 Data: ELFDATA2LSB
10 Type: ET_REL
11 Machine: EM_X86_64
12 Symbols: []
13
14 # ERR1: error: '[[INPUT]]': string table '.strtab' cannot be removed because it is referenced by the symbol table '.symtab'
15 # ERR2: error: '[[INPUT]]': string table '.strtab' cannot be removed because it is referenced by the symbol table '.symtab'
16
17 # RUN: llvm-objcopy --allow-broken-links -R .strtab %t %t4
18 # RUN: llvm-readobj --section-headers %t4 | FileCheck %s --check-prefix=SECTIONS --implicit-check-not=.strtab
19 # RUN: cp %t %t5
20 # RUN: llvm-strip --no-strip-all --allow-broken-links -R .strtab %t %t5
21 # RUN: llvm-readobj --section-headers %t5 | FileCheck %s --check-prefix=SECTIONS --implicit-check-not=.strtab
22
23 # SECTIONS: Name: .symtab
24 # SECTIONS: Link
25 # SECTIONS-SAME: : 0