1# REQUIRES: x86 2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o 3# RUN: echo "PHDRS { \ 4# RUN: exec PT_LOAD FLAGS(0x4 | 0x1); \ 5# RUN: } \ 6# RUN: SECTIONS { \ 7# RUN: .text : { *(.text) } :exec \ 8# RUN: .foo : { *(.foo) } \ 9# RUN: .bar : { *(.bar) } \ 10# RUN: /DISCARD/ : { *(.discard) } :NONE \ 11# RUN: }" > %t.script 12# RUN: ld.lld -o %t --script %t.script %t.o 13# RUN: llvm-readelf -S -l %t | FileCheck --implicit-check-not=/DISCARD/ %s 14 15## Check that /DISCARD/ does not interfere with the assignment of segments to 16## sections. 17 18# CHECK: Section Headers 19# CHECK: .text 20# CHECK-NEXT: .foo 21# CHECK-NEXT: .bar 22 23# CHECK: Segment Sections 24# CHECK-NEXT: .text .foo .bar 25 26.section .text,"ax" 27 ret 28 29.section .foo,"a" 30 .byte 0 31 32.section .bar,"ax" 33 ret 34 35.section .discard 36 .byte 0 37