1# RUN: yaml2obj %s > %t 2# RUN: not llvm-objcopy -R .symtab %t %t2 2>&1 >/dev/null | FileCheck %s 3 4!ELF 5FileHeader: 6 Class: ELFCLASS64 7 Data: ELFDATA2LSB 8 Type: ET_REL 9 Machine: EM_X86_64 10Sections: 11 - Name: .text 12 Type: SHT_PROGBITS 13 Flags: [ SHF_ALLOC, SHF_EXECINSTR ] 14 Address: 0x1000 15 AddressAlign: 0x0000000000000010 16 Content: "0000000000000000" 17 - Name: .rel.text 18 Type: SHT_REL 19 Link: .symtab 20 Info: .text 21 Relocations: 22 - Offset: 0x1000 23 Symbol: foo 24 Type: R_X86_64_PC32 25 26Symbols: 27 Global: 28 - Name: foo 29 Type: STT_FUNC 30 Size: 4 31 32# CHECK: Symbol table .symtab cannot be removed because it is referenced by the relocation section .rel.text. 33