summaryrefslogtreecommitdiff
path: root/rts/Linker.c
diff options
context:
space:
mode:
authorMoritz Angermann <moritz.angermann@gmail.com>2021-02-13 16:44:19 +0800
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-03-29 17:25:49 -0400
commite754ff7f178a629a2261cba77a29d9510391aebd (patch)
tree77aca9f315288b52efbc9d410a57300a4029279d /rts/Linker.c
parent4421fb34b3a70db1323833337c94ac4364824124 (diff)
downloadhaskell-e754ff7f178a629a2261cba77a29d9510391aebd.tar.gz
Allocate Adjustors and mark them readable in two steps
This drops allocateExec for darwin, and replaces it with a alloc, write, mark executable strategy instead. This prevents us from trying to allocate an executable range and then write to it, which X^W will prohibit on darwin. This will *only* work if we can use mmap.
Diffstat (limited to 'rts/Linker.c')
-rw-r--r--rts/Linker.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rts/Linker.c b/rts/Linker.c
index 5bc46b486d..6a294ffb8b 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -1528,7 +1528,7 @@ preloadObjectFile (pathchar *path)
*
* See also the misalignment logic for darwin below.
*/
-#if defined(ios_HOST_OS)
+#if defined(darwin_HOST_OS)
image = mmapForLinker(fileSize, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
#else
image = mmapForLinker(fileSize, PROT_READ|PROT_WRITE|PROT_EXEC,