]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/linkerscript/info-section-type.s
Vendor import of lld trunk r338150:
[FreeBSD/FreeBSD.git] / test / ELF / linkerscript / info-section-type.s
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
3
4 ## In this test we check that output section types such as
5 ## COPY, INFO and OVERLAY marks output section as non-allocatable.
6
7 # RUN: echo "SECTIONS { .bar : { *(.foo) } };" > %t.script
8 # RUN: ld.lld -o %t --script %t.script %t.o
9 # RUN: llvm-readobj -sections %t | FileCheck %s --check-prefix=DEFAULT
10 # DEFAULT:      Name: .bar
11 # DEFAULT:      Type: SHT_PROGBITS
12 # DEFAULT-NEXT: Flags [
13 # DEFAULT-NEXT:   SHF_ALLOC
14 # DEFAULT-NEXT: ]
15
16 # RUN: echo "SECTIONS { .bar (COPY) : { *(.foo) } };" > %t.script
17 # RUN: ld.lld -o %t --script %t.script %t.o
18 # RUN: llvm-readobj -sections %t | FileCheck %s --check-prefix=NONALLOC
19 # NONALLOC:      Name: .bar
20 # NONALLOC:      Type: SHT_PROGBITS
21 # NONALLOC-NEXT: Flags [
22 # NONALLOC-NEXT: ]
23
24 # RUN: echo "SECTIONS { .bar (INFO) : { *(.foo) } };" > %t.script
25 # RUN: ld.lld -o %t --script %t.script %t.o
26 # RUN: llvm-readobj -sections %t | FileCheck %s --check-prefix=NONALLOC
27
28 # RUN: echo "SECTIONS { .bar (OVERLAY) : { *(.foo) } };" > %t.script
29 # RUN: ld.lld -o %t --script %t.script %t.o
30 # RUN: llvm-readobj -sections %t | FileCheck %s --check-prefix=NONALLOC
31
32 .section .foo,"a",@progbits
33 .zero 1