summaryrefslogtreecommitdiff
path: root/rts/Linker.c
diff options
context:
space:
mode:
authorMoritz Angermann <moritz.angermann@gmail.com>2021-02-13 16:44:19 +0800
committerMoritz Angermann <moritz.angermann@gmail.com>2021-02-18 10:05:17 +0800
commitddb152d57356cf6a2649b8598e596b5e8051ded2 (patch)
treecd9ad381ed0239ac0bed561c86615c6e24dbb21d /rts/Linker.c
parentad2ef3a13f1eb000eab8e3d64592373b91a52806 (diff)
downloadhaskell-ddb152d57356cf6a2649b8598e596b5e8051ded2.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 c0d28e6581..f0c72c3a2d 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -1484,7 +1484,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,