yugr / Implib.so

POSIX equivalent of Windows DLL import libraries
MIT License
229 stars 33 forks source link

Aarch64 trampoline asm can't handle large $number #26

Closed Artem-B closed 1 year ago

Artem-B commented 1 year ago

https://github.com/yugr/Implib.so/blob/69a90e33e97cb3058121ce3345821a91205ff7d0/arch/aarch64/trampoline.S.tpl#LL32C18-L32C18

mov can only handle the values that fit into 16 bit. To guarantee that we can load larger values we should be using mov + movk. https://godbolt.org/z/9f5zx3e9r

yugr commented 1 year ago

@Artem-B I think I fixed it on master, please check.

yugr commented 1 year ago

Closing for now, let me know if problem persists.

Artem-B commented 1 year ago

Thank you for the quick fix. It appears to be working.