[AArch64] Support execute-only LOAD segments.
Summary:
This adds an LLD flag to mark executable LOAD segments execute-only for AArch64 targets.
In AArch64 the expectation is that code is execute-only compatible, so this just adds a linker option to enforce this.
Patch by: ivanlozano (Ivan Lozano)
Reviewers: srhines, echristo, peter.smith, eugenis, javed.absar, espindola, ruiu
Reviewed By: ruiu
Subscribers: dokyungs, emaste, arichardson, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D49456
llvm-svn: 338271
2018-07-31 01:02:46 +08:00
|
|
|
// REQUIRES: aarch64
|
|
|
|
|
|
|
|
// RUN: llvm-mc -filetype=obj -triple=aarch64-linux-none %s -o %t.o
|
|
|
|
|
|
|
|
// RUN: echo "SECTIONS \
|
|
|
|
// RUN: { \
|
|
|
|
// RUN: .text : { *(.text) *(.rodata.foo) } \
|
|
|
|
// RUN: .rodata : { *(.rodata.bar) } \
|
|
|
|
// RUN: }" > %t.lds
|
|
|
|
// RUN: not ld.lld -T%t.lds %t.o -o %t -execute-only 2>&1 | FileCheck %s
|
|
|
|
|
|
|
|
// RUN: echo "SECTIONS \
|
|
|
|
// RUN: { \
|
|
|
|
// RUN: .text : { *(.text) } \
|
|
|
|
// RUN: .rodata : { *(.rodata.bar) *(.rodata.foo) } \
|
|
|
|
// RUN: }" > %t.lds
|
|
|
|
// RUN: ld.lld -T%t.lds %t.o -o %t -execute-only 2>&1
|
|
|
|
|
2018-10-25 02:15:40 +08:00
|
|
|
// CHECK: cannot place {{.*}}:(.rodata.foo) into .text: -execute-only does not support intermingling data and code
|
[AArch64] Support execute-only LOAD segments.
Summary:
This adds an LLD flag to mark executable LOAD segments execute-only for AArch64 targets.
In AArch64 the expectation is that code is execute-only compatible, so this just adds a linker option to enforce this.
Patch by: ivanlozano (Ivan Lozano)
Reviewers: srhines, echristo, peter.smith, eugenis, javed.absar, espindola, ruiu
Reviewed By: ruiu
Subscribers: dokyungs, emaste, arichardson, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D49456
llvm-svn: 338271
2018-07-31 01:02:46 +08:00
|
|
|
|
|
|
|
br lr
|
|
|
|
|
|
|
|
.section .rodata.foo
|
|
|
|
.word 0x1
|
|
|
|
.section .rodata.bar
|
|
|
|
.word 0x2
|