1 ## Check we cannot remove a section containing symbols
2 ## referenced by relocations contained in the object.
4 # RUN: yaml2obj %s -o %t1
5 # RUN: not llvm-objcopy -R .data %t1 2>&1 | FileCheck %s -DINPUT=%t1
6 # CHECK: error: '[[INPUT]]': section '.data' cannot be removed: (.text+0x1) has relocation against symbol 'foo'
8 ## Check the behavior when we also remove the relocation section.
9 ## We have no reference in this case and hence no error should be emitted.
11 # RUN: yaml2obj %s -o %t2
12 # RUN: llvm-objcopy -R .data -R .rela.text %t2 %t3
13 # RUN: llvm-objdump --section-headers %t3 | FileCheck %s --check-prefix=NOSEC
15 # NOSEC-NOT: .rela.text
26 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
27 AddressAlign: 0x0000000000000004
32 AddressAlign: 0x0000000000000008
33 EntSize: 0x0000000000000018
36 - Offset: 0x0000000000000001
38 Type: R_X86_64_GOTPCREL
42 Flags: [ SHF_WRITE, SHF_ALLOC ]
43 AddressAlign: 0x0000000000000001
48 Value: 0x0000000000000001