1 # RUN: yaml2obj %s -o %t
\r
3 ## Check we cannot remove the .dynsym symbol table because dynamic
\r
4 ## relocation section .rela.dyn still references it via sh_link field.
\r
5 # RUN: not llvm-objcopy -R .dynsym %t %t2 2>&1 >/dev/null | FileCheck %s --check-prefix=ERR -DINPUT=%t
\r
6 # ERR: error: '[[INPUT]]': symbol table '.dynsym' cannot be removed because it is referenced by the relocation section '.rela.dyn'
\r
8 ## Check we can remove .dynsym after removing the reference.
\r
9 # RUN: llvm-objcopy -R .dynsym -R .rela.dyn %t %t2
\r
10 # RUN: llvm-readelf --sections %t2 | FileCheck %s --implicit-check-not=".dynsym"
\r
12 ## Check we zero out sh_link field and allow producing output with the --allow-broken-links switch.
\r
13 # RUN: llvm-objcopy -R .dynsym --allow-broken-links %t %t2
\r
14 # RUN: llvm-readelf --sections %t2 | FileCheck %s --check-prefix=DROP-LINK
\r
15 # DROP-LINK: [Nr] Name Type Address Off Size ES Flg L
\r
16 # DROP-LINK: [ 1] .rela.dyn RELA 0000000000000270 000040 000000 18 A 0
\r
17 # DROP-LINK-NOT: .dynsym
\r
28 Flags: [ SHF_ALLOC ]
\r
29 Address: 0x0000000000000270
\r
31 EntSize: 0x0000000000000018
\r