You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func:
add w0, w0, w1
ret x30
load_global:
libc++abi: terminating with uncaught exception of type std::logic_error: AsmJit error: InvalidDisplacement: adrp x0, func
By the way, I found that there is no way to implement add x0, x0, :lo12:func in asmjit AArch64.
The text was updated successfully, but these errors were encountered:
ApsarasX
changed the title
How to load label address to register in AArch64
There is no way to implement add x0, x0, :lo12:label in asmjit AArch64.
May 6, 2023
ApsarasX
changed the title
There is no way to implement add x0, x0, :lo12:label in asmjit AArch64.
Unexpected error when load label address to register in AArch64
May 6, 2023
I initially started hacking this feature, but then I have decided that this cannot just be a hacky feature. My current idea is to add a support to have Imm to actually represent an expression, which would just calculate the value once the code is being relocated.
But I cannot make this like tomorrow, this would need a careful design so it won't regress the performance and it would work with all instructions (I think even x86 backend then should get this feature).
I'm sorry, but no progress on this front - I don't have time capacity to work on this at the moment.
I plan to generate AArch64 assembler similarly to how ARM32 assembler is generated (in a separate branch atm), which would be able to handle expressions with labels (that's a feature that is not really ready at the moment). But this is not a high priority now because of time constraints.
I can reconsider if there is a big interest in having this functional.
The assembly code I want.
My usage
Result:
func: add w0, w0, w1 ret x30 load_global: libc++abi: terminating with uncaught exception of type std::logic_error: AsmJit error: InvalidDisplacement: adrp x0, func
By the way, I found that there is no way to implement
add x0, x0, :lo12:func
in asmjit AArch64.The text was updated successfully, but these errors were encountered: