diff options
author | marcel <marcel@FreeBSD.org> | 2011-10-13 16:16:46 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2011-10-13 16:16:46 +0000 |
commit | 92e552423dd1f9f8017a9fc26d74339a0b2a626f (patch) | |
tree | 0b4c76dc5e5a6ce67abf2cee057695297ff439a2 /sys/kern/imgact_elf.c | |
parent | 70198a61686f1b0df12f1fde7ddd651c4cbb7f33 (diff) | |
download | FreeBSD-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/imgact_elf.c')
-rw-r--r-- | sys/kern/imgact_elf.c | 6 |
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); } |