xref: /llvm-project/lld/test/ELF/relro-non-contiguous-script-data.s (revision 443baed56c770aca050d27581d5d6f0c5c168285)
1// REQUIRES: x86
2
3// RUN: llvm-mc -filetype=obj -triple=x86_64 /dev/null -o %t2.o
4// RUN: ld.lld -shared -soname=t2 %t2.o -o %t2.so
5// RUN: echo "SECTIONS { \
6// RUN: .dynamic : { *(.dynamic) } \
7// RUN: .non_ro : { . += 1; } \
8// RUN: .jcr : { *(.jcr) } \
9// RUN: } " > %t.script
10// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
11// RUN: not ld.lld %t.o %t2.so -o /dev/null --script=%t.script 2>&1 | FileCheck %s
12
13// RUN: echo "SECTIONS { \
14// RUN: .dynamic : { *(.dynamic) } \
15// RUN: .non_ro : { BYTE(1); } \
16// RUN: .jcr : { *(.jcr) } \
17// RUN: } " > %t2.script
18// RUN: not ld.lld %t.o %t2.so -o /dev/null --script=%t2.script 2>&1 | FileCheck %s
19
20// CHECK: error: section: .jcr is not contiguous with other relro sections
21
22.global _start
23_start:
24
25        // non-empty relro section
26        .section .jcr, "aw", @progbits
27        .quad 0
28