Commit 7fe898db authored by Martin Storsjö's avatar Martin Storsjö Committed by 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
c44a8a3e.
Signed-off-by: 's avatarRonald S. Bultje <rsbultje@gmail.com>
parent 6bec60a6
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment