47 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t3# RUN: echo "SECTIONS { \4# RUN: .writable : ONLY_IF_RW { *(.writable) } \5# RUN: .readable : ONLY_IF_RO { *(.readable) }}" > %t.script6# RUN: ld.lld -o %t1 --script %t.script %t7# RUN: llvm-objdump --section-headers %t1 | \8# RUN: FileCheck -check-prefix=BASE %s9# BASE: Sections:10# BASE-NEXT: Idx Name Size11# BASE-NEXT: 0 0000000012# BASE: .writable 0000000413# BASE: .readable 0000000414 15# RUN: echo "SECTIONS { \16# RUN: .foo : ONLY_IF_RO { *(.foo.*) } \17# RUN: .writable : ONLY_IF_RW { *(.writable) } \18# RUN: .readable : ONLY_IF_RO { *(.readable) }}" > %t2.script19# RUN: ld.lld -o %t2 --script %t2.script %t20# RUN: llvm-objdump --section-headers %t2 | \21# RUN: FileCheck -check-prefix=NO1 %s22# NO1: Sections:23# NO1-NEXT: Idx Name Size24# NO1-NEXT: 0 0000000025# NO1: .writable 0000000426# NO1: .foo.2 0000000427# NO1: .readable 0000000428# NO1: .foo.1 0000000429 30.global _start31_start:32 nop33 34.section .writable, "aw"35writable:36 .long 137 38.section .readable, "a"39readable:40 .long 241 42.section .foo.1, "awx"43 .long 044 45.section .foo.2, "aw"46 .long 047