[commit: ghc] master: linker: Shuffle configuration into LinkerInternals.h (abfa319)

git at git.haskell.org git at git.haskell.org
Wed Nov 2 20:14:59 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/abfa3196a19cd8912fdbae121641474b3261d7cf/ghc

>---------------------------------------------------------------

commit abfa3196a19cd8912fdbae121641474b3261d7cf
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Wed Nov 2 15:00:44 2016 -0400

    linker: Shuffle configuration into LinkerInternals.h
    
    Test Plan: Validate
    
    Reviewers: erikd, austin, simonmar
    
    Reviewed By: simonmar
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2644


>---------------------------------------------------------------

abfa3196a19cd8912fdbae121641474b3261d7cf
 rts/Linker.c          | 17 -----------------
 rts/LinkerInternals.h | 24 ++++++++++++++++++++++++
 2 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/rts/Linker.c b/rts/Linker.c
index 3e94069..74b4822 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -56,23 +56,6 @@
 #include <dlfcn.h>
 #endif
 
-/* PowerPC and ARM have relative branch instructions with only 24 bit
- * displacements and therefore need jump islands contiguous with each object
- * code module.
- */
-#if defined(powerpc_HOST_ARCH)
-#define SHORT_REL_BRANCH 1
-#endif
-#if defined(arm_HOST_ARCH)
-#define SHORT_REL_BRANCH 1
-#endif
-
-#if (RTS_LINKER_USE_MMAP && defined(SHORT_REL_BRANCH) && defined(linux_HOST_OS))
-#define USE_CONTIGUOUS_MMAP 1
-#else
-#define USE_CONTIGUOUS_MMAP 0
-#endif
-
 #if defined(linux_HOST_OS) || defined(solaris2_HOST_OS) || defined(freebsd_HOST_OS) || defined(kfreebsdgnu_HOST_OS) || defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS) || defined(gnu_HOST_OS)
 #  define OBJFORMAT_ELF
 #  include <regex.h>    // regex is already used by dlopen() so this is OK
diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h
index 729cf1d..460beae 100644
--- a/rts/LinkerInternals.h
+++ b/rts/LinkerInternals.h
@@ -301,4 +301,28 @@ getting, here. */
 
 #endif /* OBJFORMAT_PEi386 */
 
+
+/*************************************************
+ * Various bits of configuration
+ *************************************************/
+
+/* PowerPC and ARM have relative branch instructions with only 24 bit
+ * displacements and therefore need jump islands contiguous with each object
+ * code module.
+ */
+#if defined(powerpc_HOST_ARCH)
+#define SHORT_REL_BRANCH 1
+#endif
+#if defined(arm_HOST_ARCH)
+#define SHORT_REL_BRANCH 1
+#endif
+
+#if (RTS_LINKER_USE_MMAP && defined(SHORT_REL_BRANCH) && defined(linux_HOST_OS))
+#define USE_CONTIGUOUS_MMAP 1
+#else
+#define USE_CONTIGUOUS_MMAP 0
+#endif
+
+
+
 #endif /* LINKERINTERNALS_H */



More information about the ghc-commits mailing list