summaryrefslogtreecommitdiff
path: root/sys/arch/arm64
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2017-10-24 20:06:55 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2017-10-24 20:06:55 +0000
commitcc92a49c1d2dd362b9d0502347afdbd9836bcf9b (patch)
tree2822fc39eaf43dcf5002d07129cc3da7e2507fbd /sys/arch/arm64
parente7e899e65b9f7ed361218bbfff41c1596ae8c59c (diff)
In ld scripts, an output section with no input sections is always marked
writable, so the stub gap.o has .rodata flagged as RW. Instead of letting that propagate to the final :rodata PT_LOAD section, force the flags on the section to 4 (==PF_R) in the PHDRS block. problem noted by mortimer@ ok deraadt@ kettenis@
Diffstat (limited to 'sys/arch/arm64')
-rw-r--r--sys/arch/arm64/conf/kern.ldscript4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/arm64/conf/kern.ldscript b/sys/arch/arm64/conf/kern.ldscript
index f4420390c03..4f6f17d6bb0 100644
--- a/sys/arch/arm64/conf/kern.ldscript
+++ b/sys/arch/arm64/conf/kern.ldscript
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern.ldscript,v 1.6 2017/10/04 21:04:56 patrick Exp $ */
+/* $OpenBSD: kern.ldscript,v 1.7 2017/10/24 20:06:54 guenther Exp $ */
/* $NetBSD: ldscript.evbarm,v 1.2 2003/03/05 23:54:22 thorpej Exp $ */
OUTPUT_ARCH(aarch64)
@@ -7,7 +7,7 @@ OUTPUT_ARCH(aarch64)
PHDRS
{
text PT_LOAD;
- rodata PT_LOAD;
+ rodata PT_LOAD FLAGS (4);
data PT_LOAD;
openbsd_randomize PT_OPENBSD_RANDOMIZE;
}