aarch64: Add parentheses around the offset parameter in movrel
[ffmpeg.git] / libavutil / aarch64 / asm.S
index 6a7f506d130ac157e45a2fd54f198c6059c89e35..86d36cd57fe2e0d28660cf40ef28b44eea7a76f8 100644 (file)
@@ -72,15 +72,21 @@ ELF     .size   \name, . - \name
 \name:
 .endm
 
-.macro  movrel rd, val
+.macro  movrel rd, val, offset=0
 #if CONFIG_PIC && defined(__APPLE__)
+    .if \offset < 0
         adrp            \rd, \val@PAGE
         add             \rd, \rd, \val@PAGEOFF
+        sub             \rd, \rd, -(\offset)
+    .else
+        adrp            \rd, \val+(\offset)@PAGE
+        add             \rd, \rd, \val+(\offset)@PAGEOFF
+    .endif
 #elif CONFIG_PIC
-        adrp            \rd, \val
-        add             \rd, \rd, :lo12:\val
+        adrp            \rd, \val+(\offset)
+        add             \rd, \rd, :lo12:\val+(\offset)
 #else
-        ldr             \rd, =\val
+        ldr             \rd, =\val+\offset
 #endif
 .endm