[commit: ghc] ghc-8.0: Linker: Use contiguous mmapping on ARM (266bc33)
git at git.haskell.org
git at git.haskell.org
Sun Jan 3 20:08:33 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.0
Link : http://ghc.haskell.org/trac/ghc/changeset/266bc33cc6ac7c328ae3847e23df8681d8172d0a/ghc
>---------------------------------------------------------------
commit 266bc33cc6ac7c328ae3847e23df8681d8172d0a
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
(cherry picked from commit 07d127ad23c7e6056471d218adcc8ec5119fac6c)
>---------------------------------------------------------------
266bc33cc6ac7c328ae3847e23df8681d8172d0a
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