ref: 588cbf94dd8ff75dd2d4b7b0a3c66f663184a192
parent: 9824c5d9c75816aefdb0c122c31159a405c35d64
author: Martin Storsjö <martin@martin.st>
date: Thu Jan 10 18:47:21 EST 2019
arm: Fix the movrel macro for Apple with PIC
--- a/src/arm/32/util.S
+++ b/src/arm/32/util.S
@@ -33,7 +33,20 @@
#include "src/arm/asm.S"
.macro movrel rd, val
-#if defined(PIC)
+#if defined(PIC) && defined(__APPLE__)
+ ldr \rd, 1f
+ b 2f
+1:
+@ FIXME: thumb
+ .word 3f - (2f + 8)
+2:
+ ldr \rd, [pc, \rd]
+ .non_lazy_symbol_pointer
+3:
+ .indirect_symbol \val
+ .word 0
+ .text
+#elif defined(PIC)
ldr \rd, 1f
b 2f
1: