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

Michael Niedermayer michael at niedermayer.cc
Thu Dec 8 18:23:33 EET 2016


On Tue, Nov 15, 2016 at 09:14:06PM +0100, Martin Storsjö wrote:
> ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Mon Nov 14 12:32:24 2016 +0200| [7fe898dbb949f0e31665d716f671e2428d50bb29] | committer: Ronald S. Bultje
> 
> 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 at gmail.com>
> 
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7fe898dbb949f0e31665d716f671e2428d50bb29
> ---
> 
>  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 ff34e7a..523b8c5 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

This breaks build on mac osx

6 warnings generated.
AS      libavcodec/aarch64/h264idct_neon.o
CC      libavcodec/aarch64/h264pred_init.o
<instantiation>:8:21: error: expected compatible register, symbol or integer in range [0, 4095]
        add x7, x7, scan8+16+(0)@PAGEOFF
                    ^
libavcodec/aarch64/h264idct_neon.S:165:9: note: while in macro instantiation
        movrel x7, scan8+16
        ^
make: *** [libavcodec/aarch64/h264idct_neon.o] Error 1
make: *** Waiting for unfinished jobs....



[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-cvslog/attachments/20161208/2c6084e7/attachment.sig>


More information about the ffmpeg-cvslog mailing list