llvm.org GIT mirror llvm / stable test / tools / llvm-objcopy / ELF / symtab-error-on-remove-strtab.test
stable

Tree @stable (Download .tar.gz)

symtab-error-on-remove-strtab.test @stableraw · history · blame

# RUN: yaml2obj %s > %t
# RUN: not llvm-objcopy -R .strtab %t %t2 2>&1 >/dev/null | FileCheck %s --check-prefix=ERR
# RUN: cp %t %t3
# RUN: not llvm-strip --no-strip-all -R .strtab %t3 2>&1 >/dev/null | FileCheck %s --check-prefix=ERR

!ELF
FileHeader:
  Class:           ELFCLASS64
  Data:            ELFDATA2LSB
  Type:            ET_REL
  Machine:         EM_X86_64

# ERR: String table .strtab cannot be removed because it is referenced by the symbol table .symtab

# RUN: llvm-objcopy --allow-broken-links -R .strtab %t %t4
# RUN: llvm-objdump --section-headers %t4 | FileCheck %s --check-prefix=SECTIONS --implicit-check-not=.strtab
# RUN: cp %t %t5
# RUN: llvm-strip --no-strip-all --allow-broken-links -R .strtab %t %t5
# RUN: llvm-objdump --section-headers %t5 | FileCheck %s --check-prefix=SECTIONS --implicit-check-not=.strtab

# SECTIONS: .symtab