// REQUIRES: x86

// RUN: echo "SECTIONS { \
// RUN: .dynamic : { *(.dynamic) } \
// RUN: .non_ro : { . += 1; } \
// RUN: .jcr : { *(.jcr) } \
// RUN: } " > %t.script
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
// RUN: not ld.lld --export-dynamic %t.o -o %t --script=%t.script 2>&1 | FileCheck %s

// CHECK: error: section: .jcr is not contiguous with other relro sections

.global _start
_start:

        // non-empty relro section
        .section .jcr, "aw", @progbits
        .quad 0

// REQUIRES: x86

// RUN: echo "SECTIONS { \
// RUN: .dynamic : { *(.dynamic) } \
// RUN: .non_ro : { . += 1; } \
// RUN: .jcr : { *(.jcr) } \
// RUN: } " > %t.script
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
// RUN: not ld.lld --export-dynamic %t.o -o %t --script=%t.script 2>&1 | FileCheck %s

// RUN: echo "SECTIONS { \
// RUN: .dynamic : { *(.dynamic) } \
// RUN: .non_ro : { BYTE(1); } \
// RUN: .jcr : { *(.jcr) } \
// RUN: } " > %t2.script
// RUN: not ld.lld --export-dynamic %t.o -o %t --script=%t2.script 2>&1 | FileCheck %s

// CHECK: error: section: .jcr is not contiguous with other relro sections

.global _start
_start:

        // non-empty relro section
        .section .jcr, "aw", @progbits
        .quad 0

Add BYTE expression to test case for non-contiguous relro
[ELF] Add BYTE expression to test case for non-contiguous relro [NFC]

As well as location counter expressions. The data generating expressions
such as BYTE can generate a non-zero sized OutputSection that will report
0 until assignAddresses() is called. Add an example to the existing test
case relro-non-contiguous-script-data.s.

Differential Revision: https://reviews.llvm.org/D40732



git-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@319648 91177308-0d34-0410-b5e6-96231b3b80d8
