diff options
author | Martin Storsjö <martin@martin.st> | 2017-07-09 23:52:10 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2017-08-22 13:41:08 +0300 |
commit | 7b7760ad6efb7b96122aa7133ad21e22653ae222 (patch) | |
tree | 965eff02735c51e4a26e3f5c4e049a8316240e6d /libavutil | |
parent | 0c99b900d874b60ce89b94742b2215f163c87a2b (diff) | |
download | ffmpeg-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')
-rw-r--r-- | libavutil/aarch64/asm.S | 9 |
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) |