2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
4 ## Test that section .foo is not placed in any segment when assigned to segment
5 ## NONE in the linker script and segment NONE is not defined.
6 # RUN: echo "PHDRS {text PT_LOAD;} \
8 # RUN: .text : {*(.text .text*)} :text \
9 # RUN: .foo : {*(.foo)} :NONE \
11 # RUN: ld.lld -o %t --script %t.script %t.o
12 # RUN: llvm-readelf -S -l %t | FileCheck %s
14 ## Test that section .foo is placed in segment NONE when assigned to segment
15 ## NONE in the linker script and segment NONE is defined.
16 # RUN: echo "PHDRS {text PT_LOAD; NONE PT_LOAD;} \
18 # RUN: .text : {*(.text .text*)} :text \
19 # RUN: .foo : {*(.foo)} :NONE \
21 # RUN: ld.lld -o %t --script %t.script %t.o
22 # RUN: llvm-readelf -S -l %t | FileCheck --check-prefix=DEFINED %s
24 # CHECK: Section to Segment mapping:
25 # CHECK-NEXT: Segment Sections...
26 # CHECK: None {{.*}}.foo
28 # DEFINED: Section to Segment mapping:
29 # DEFINED-NEXT: Segment Sections...
30 # DEFINED-NEXT: 00 .text
31 # DEFINED-NEXT: 01 .foo