summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorpho@cielonegro.org <unknown>2010-11-30 14:30:14 +0000
committerpho@cielonegro.org <unknown>2010-11-30 14:30:14 +0000
commit7cd02e3ecf0befebd65145166a0e97087ca2c562 (patch)
tree04fed1ed5ad7b8443060e0b9d5f8821d5a3eeec2 /rts
parentc8749d21d9fbb5c644b098fee74caf876ca5206c (diff)
downloadhaskell-7cd02e3ecf0befebd65145166a0e97087ca2c562.tar.gz
FIX #1845 (unconditional relative branch out of range)
Don't use mmap on powerpc-apple-darwin as mmap doesn't support reallocating but we need to allocate jump islands just after each object images. Otherwise relative branches to jump islands can fail due to 24-bits displacement overflow.
Diffstat (limited to 'rts')
-rw-r--r--rts/Linker.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/rts/Linker.c b/rts/Linker.c
index 92c1197f32..2894b1e2dd 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -69,7 +69,15 @@
#include <sys/wait.h>
#endif
-#if defined(linux_HOST_OS) || defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS) || defined(darwin_HOST_OS)
+#if defined(linux_HOST_OS ) || defined(freebsd_HOST_OS) || \
+ defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS ) || \
+ defined(openbsd_HOST_OS ) || \
+ ( defined(darwin_HOST_OS ) && !defined(powerpc_HOST_ARCH) )
+/* Don't use mmap on powerpc-apple-darwin as mmap doesn't support
+ * reallocating but we need to allocate jump islands just after each
+ * object images. Otherwise relative branches to jump islands can fail
+ * due to 24-bits displacement overflow.
+ */
#define USE_MMAP
#include <fcntl.h>
#include <sys/mman.h>
@@ -1960,6 +1968,9 @@ loadObj( char *path )
int fd;
#else
FILE *f;
+# if defined(darwin_HOST_OS)
+ int misalignment;
+# endif
#endif
IF_DEBUG(linker, debugBelch("loadObj %s\n", path));