summaryrefslogtreecommitdiffstats
path: root/libavutil/aarch64/asm.S
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2017-07-09 23:52:10 +0300
committerMartin Storsjö <martin@martin.st>2017-08-22 13:41:08 +0300
commit7b7760ad6efb7b96122aa7133ad21e22653ae222 (patch)
tree965eff02735c51e4a26e3f5c4e049a8316240e6d /libavutil/aarch64/asm.S
parent0c99b900d874b60ce89b94742b2215f163c87a2b (diff)
downloadffmpeg-streaming-7b7760ad6efb7b96122aa7133ad21e22653ae222.zip
ffmpeg-streaming-7b7760ad6efb7b96122aa7133ad21e22653ae222.tar.gz
aarch64: Fix negative movrel offsets for windows
On windows, the offset for the relocation doesn't get stored in the relocation itself, but as an unsigned immediate in the opcode. Therefore, negative offsets has to be handled via a separate sub instruction, just as on MachO. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavutil/aarch64/asm.S')
-rw-r--r--libavutil/aarch64/asm.S9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavutil/aarch64/asm.S b/libavutil/aarch64/asm.S
index 86d36cd..7e2af4d 100644
--- a/libavutil/aarch64/asm.S
+++ b/libavutil/aarch64/asm.S
@@ -82,6 +82,15 @@ ELF .size \name, . - \name
adrp \rd, \val+(\offset)@PAGE
add \rd, \rd, \val+(\offset)@PAGEOFF
.endif
+#elif CONFIG_PIC && defined(_WIN32)
+ .if \offset < 0
+ adrp \rd, \val
+ add \rd, \rd, :lo12:\val
+ sub \rd, \rd, -(\offset)
+ .else
+ adrp \rd, \val+(\offset)
+ add \rd, \rd, :lo12:\val+(\offset)
+ .endif
#elif CONFIG_PIC
adrp \rd, \val+(\offset)
add \rd, \rd, :lo12:\val+(\offset)
OpenPOWER on IntegriCloud