]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/linkerscript/discard-section-err.s
Vendor import of lld trunk r338150:
[FreeBSD/FreeBSD.git] / test / ELF / linkerscript / discard-section-err.s
1 # REQUIRES: x86
2
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
4
5 # RUN: echo "SECTIONS { /DISCARD/ : { *(.shstrtab) } }" > %t.script
6 # RUN: not ld.lld -o %t --script %t.script %t.o 2>&1 | \
7 # RUN:   FileCheck -check-prefix=SHSTRTAB %s
8 # SHSTRTAB: discarding .shstrtab section is not allowed
9
10 # RUN: echo "SECTIONS { /DISCARD/ : { *(.dynamic) } }" > %t.script
11 # RUN: not ld.lld -pie -o %t --script %t.script %t.o 2>&1 | \
12 # RUN:   FileCheck -check-prefix=DYNAMIC %s
13 # DYNAMIC: discarding .dynamic section is not allowed
14
15 # RUN: echo "SECTIONS { /DISCARD/ : { *(.dynsym) } }" > %t.script
16 # RUN: not ld.lld -pie -o %t --script %t.script %t.o 2>&1 | \
17 # RUN:   FileCheck -check-prefix=DYNSYM %s
18 # DYNSYM: discarding .dynsym section is not allowed
19
20 # RUN: echo "SECTIONS { /DISCARD/ : { *(.dynstr) } }" > %t.script
21 # RUN: not ld.lld -pie -o %t --script %t.script %t.o 2>&1 | \
22 # RUN:   FileCheck -check-prefix=DYNSTR %s
23 # DYNSTR: discarding .dynstr section is not allowed
24
25 # RUN: echo "SECTIONS { /DISCARD/ : { *(.rela.plt) } }" > %t.script
26 # RUN: not ld.lld -pie -o %t --script %t.script %t.o 2>&1 | \
27 # RUN:   FileCheck -check-prefix=RELAPLT %s
28 # RELAPLT: discarding .rela.plt section is not allowed
29
30 # RUN: echo "SECTIONS { /DISCARD/ : { *(.rela.dyn) } }" > %t.script
31 # RUN: not ld.lld -pie -o %t --script %t.script %t.o 2>&1 | \
32 # RUN:   FileCheck -check-prefix=RELADYN %s
33 # RELADYN: discarding .rela.dyn section is not allowed
34
35 .comm foo,4,4