[commit: ghc] master: Linker: Use contiguous mmapping on ARM (07d127a)
git at git.haskell.org
git at git.haskell.org
Sun Jan 3 15:56:04 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/07d127ad23c7e6056471d218adcc8ec5119fac6c/ghc
>---------------------------------------------------------------
commit 07d127ad23c7e6056471d218adcc8ec5119fac6c
Author: Ben Gamari <ben at smart-cactus.org>
Date: Sun Jan 3 13:21:39 2016 +0100
Linker: Use contiguous mmapping on ARM
ARM has a 24-bit relative jump offset just like PowerPC. Ensure that
symbols don't get too far from their symbol extras.
See #11340.
Differential Revision: https://phabricator.haskell.org/D1728
>---------------------------------------------------------------
07d127ad23c7e6056471d218adcc8ec5119fac6c
rts/Linker.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/rts/Linker.c b/rts/Linker.c
index c5781eeff..e6f63cb 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -79,10 +79,18 @@
#endif
-/* PowerPC has relative branch instructions with only 24 bit displacements
- * and therefore needs jump islands contiguous with each object code module.
+/* PowerPC and ARM have relative branch instructions with only 24 bit
+ * displacements and therefore need jump islands contiguous with each object
+ * code module.
*/
-#if (USE_MMAP && defined(powerpc_HOST_ARCH) && defined(linux_HOST_OS))
+#if defined(powerpc_HOST_ARCH)
+#define SHORT_REL_BRANCH 1
+#endif
+#if defined(arm_HOST_ARCH)
+#define SHORT_REL_BRANCH 1
+#endif
+
+#if (USE_MMAP && defined(SHORT_REL_BRANCH) && defined(linux_HOST_OS))
#define USE_CONTIGUOUS_MMAP 1
#else
#define USE_CONTIGUOUS_MMAP 0
More information about the ghc-commits
mailing list