49 lines · plain
1# RUN: yaml2obj %s -o %t2 3## Check we are able to strip all symbols and relocatable information at the same time.4 5# RUN: llvm-objcopy -S %t %t26# RUN: llvm-objdump --section-headers %t2 | FileCheck %s7 8# RUN: llvm-objcopy --strip-all-gnu %t %t29# RUN: llvm-objdump --section-headers %t2 | FileCheck %s10 11# CHECK-NOT: .symtab12# CHECK-NOT: .rela.text13 14## Check we are able to strip the particular symbol if we15## strip the corresponding relocation section at the same time.16 17# RUN: llvm-objcopy --strip-symbol=bar -R .rela.text %t %t218# RUN: llvm-readelf -s -S %t2 | FileCheck %s --check-prefix=STRIPSYM19 20# STRIPSYM-NOT: bar21# STRIPSYM-NOT: .rela.text22 23# RUN: not llvm-objcopy --strip-symbol=bar %t %t2 2>&1 | FileCheck %s --check-prefix=ERR -DINPUT=%t24# ERR: error: '[[INPUT]]': not stripping symbol 'bar' because it is named in a relocation25 26--- !ELF27FileHeader:28 Class: ELFCLASS6429 Data: ELFDATA2LSB30 Type: ET_REL31 Machine: EM_X86_6432Sections:33 - Name: .text34 Type: SHT_PROGBITS35 Flags: [ SHF_ALLOC, SHF_EXECINSTR ] 36 Content: 0000000037 - Name: .rela.text38 Type: SHT_RELA39 Link: .symtab40 Info: .text41 Relocations:42 - Offset: 0x000000000000000043 Symbol: bar44 Type: R_X86_64_32S45Symbols:46 - Name: bar47 Section: .text48 Binding: STB_GLOBAL49