summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2011-10-13 16:16:46 +0000
committermarcel <marcel@FreeBSD.org>2011-10-13 16:16:46 +0000
commit92e552423dd1f9f8017a9fc26d74339a0b2a626f (patch)
tree0b4c76dc5e5a6ce67abf2cee057695297ff439a2 /sys/kern
parent70198a61686f1b0df12f1fde7ddd651c4cbb7f33 (diff)
downloadFreeBSD-src-92e552423dd1f9f8017a9fc26d74339a0b2a626f.zip
FreeBSD-src-92e552423dd1f9f8017a9fc26d74339a0b2a626f.tar.gz
In elf32_trans_prot() and when compiling for amd64 or ia64, add
PROT_EXECUTE when PROT_READ is needed. By default i386 allows execution when reading is allowed and JDK 1.4.x depends on that.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/imgact_elf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 45f6d64..669c652 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -1664,6 +1664,12 @@ __elfN(trans_prot)(Elf_Word flags)
prot |= VM_PROT_WRITE;
if (flags & PF_R)
prot |= VM_PROT_READ;
+#if __ELF_WORD_SIZE == 32
+#if defined(__amd64__) || defined(__ia64__)
+ if (flags & PF_R)
+ prot |= VM_PROT_EXECUTE;
+#endif
+#endif
return (prot);
}
OpenPOWER on IntegriCloud