[FFmpeg-cvslog] aarch64: Add an offset parameter to the movrel macro

Martin Storsjö git at videolan.org
Fri Mar 31 21:26:56 EEST 2017


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Wed Nov  9 11:47:57 2016 +0200| [c44a8a3eabcd6acd2ba79f32ec8a432e6ebe552c] | committer: Martin Storsjö

aarch64: Add an offset parameter to the movrel macro

With apple tools, the linker fails with errors like these, if the
offset is negative:

ld: in section __TEXT,__text reloc 8: symbol index out of range for architecture arm64

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c44a8a3eabcd6acd2ba79f32ec8a432e6ebe552c
---

 libavutil/aarch64/asm.S | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/libavutil/aarch64/asm.S b/libavutil/aarch64/asm.S
index 6a7f506..0fc649a 100644
--- a/libavutil/aarch64/asm.S
+++ b/libavutil/aarch64/asm.S
@@ -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 at PAGE
         add             \rd, \rd, \val at 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
 



More information about the ffmpeg-cvslog mailing list