refactor(build): introduce adr_l macro

Introduce the macro "adr_l," which can handle symbols or labels that
exceed the 1MB access range compared to the "adr" instruction.

Change-Id: Iab2a2a2f8a11a5e21e386f1001ba27a8de621132
Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
This commit is contained in:
Hsin-Hsiung Wang 2024-02-22 15:16:32 +08:00 committed by hsin-hsiung.wang
parent af58f6d4a5
commit 31857d4cba
2 changed files with 17 additions and 0 deletions

View file

@ -241,4 +241,13 @@ div2:
cmp \temp, \bot
bhs div2
.endm
/*
* Helper macro to instruction adr <reg>, <symbol> where <symbol> is
* within the range +/- 4 GB.
*/
.macro adr_l, dst, sym
adrp \dst, \sym
add \dst, \dst, :lo12:\sym
.endm
#endif /* ASM_MACROS_S */

View file

@ -317,4 +317,12 @@
#endif
.endm
/*
* Helper macro to instruction adr <reg>, <symbol> where <symbol> is
* within the range +/- 4 GB.
*/
.macro adr_l, dst, sym
adrp \dst, \sym
add \dst, \dst, :lo12:\sym
.endm
#endif /* ASM_MACROS_S */