summaryrefslogtreecommitdiff
path: root/rts/Linker.c
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2016-01-04 16:36:33 +0100
committerBen Gamari <ben@smart-cactus.org>2016-01-04 16:38:49 +0100
commit7e599f53e12e97a7e043919cd0d8b96f11bb18c0 (patch)
tree631f98d619aaa0d36bfa2a8015deefd3c848db92 /rts/Linker.c
parentc7d84d2603c1988125feaab54e0d776974e46f75 (diff)
downloadhaskell-7e599f53e12e97a7e043919cd0d8b96f11bb18c0.tar.gz
Linker: Move helpers to #ifdef
Otherwise Clang seems to complain about unused static definitions.
Diffstat (limited to 'rts/Linker.c')
-rw-r--r--rts/Linker.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/rts/Linker.c b/rts/Linker.c
index 6561e05654..d298179596 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -2750,17 +2750,6 @@ static int ocAllocateSymbolExtras( ObjectCode* oc, int count, int first )
#endif
#endif // NEED_SYMBOL_EXTRAS
-// Signed extend a number to a 32-bit int.
-static inline StgInt32 sign_extend32(nat bits, StgWord32 x) {
- return ((StgInt32) (x << (32 - bits))) >> (32 - bits);
-}
-
-// Does the given signed integer fit into the given bit width?
-static inline StgBool is_int(nat bits, StgInt32 x) {
- return bits > 32 || (-(1 << (bits-1)) <= x
- && x < (1 << (bits-1)));
-}
-
#if defined(arm_HOST_ARCH)
static void
@@ -4990,6 +4979,21 @@ end:
return result;
}
+#ifdef arm_HOST_ARCH
+// TODO: These likely belong in a library somewhere
+
+// Signed extend a number to a 32-bit int.
+static inline StgInt32 sign_extend32(nat bits, StgWord32 x) {
+ return ((StgInt32) (x << (32 - bits))) >> (32 - bits);
+}
+
+// Does the given signed integer fit into the given bit width?
+static inline StgBool is_int(nat bits, StgInt32 x) {
+ return bits > 32 || (-(1 << (bits-1)) <= x
+ && x < (1 << (bits-1)));
+}
+#endif
+
/* Do ELF relocations which lack an explicit addend. All x86-linux
and arm-linux relocations appear to be of this form. */
static int