AOT file loading error on aarch64 Android #2112
protobird-git
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am trying to run AOT on aarch64 Android, but get this error:
"AOT module load failed: target address out of range."
With error loggings, I found that it's because data sections are mmap'ed too far from text sections, and fails when it tries to relocate with R_AARCH64_ADR_PREL_PG_HI21 which assumes the target address within 4GB from current PC. Android seems to assign memory regions based on size without hints. So, I put some workaround to mmap with MMAP_FIXED and hints.
When I checked with my android devices and desktops, all shlibs are loaded in consecutive memory regions that text sections and data sections stay together.
Shouldn't aot_loader do it similarly? So, instead of anonymous mmap per section, either one mmap for all sections, or mmap per section with MMAP_FIXED?
And, it would make sense that aot_loader uses custom memory allocator instead of os_mmap() if it's configured so.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions