diff options
author | Martin Storsjö <martin@martin.st> | 2016-11-14 12:32:24 +0200 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2016-11-15 15:10:03 -0500 |
commit | 7fe898dbb949f0e31665d716f671e2428d50bb29 (patch) | |
tree | cb9aee06e57af0d83b91634225fd128426501023 /libavutil/aarch64 | |
parent | 6bec60a683a530ac3bf5a19e5c3d087b5dd047a1 (diff) | |
download | ffmpeg-7fe898dbb949f0e31665d716f671e2428d50bb29.tar.gz |
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
This is cherry-picked from libav commit
c44a8a3eabcd6acd2ba79f32ec8a432e6ebe552c.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavutil/aarch64')
-rw-r--r-- | libavutil/aarch64/asm.S | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libavutil/aarch64/asm.S b/libavutil/aarch64/asm.S index ff34e7a5e5..523b8c5b4c 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@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 |