Is the 16KB alignment requirement for 64 bit ABIs?

103 views
Skip to first unread message

Vishal Ratna

unread,
Jul 21, 2025, 9:05:07 AMJul 21
to android-ndk
The documentation says
  1. If any arm64-v8a or x86_64 shared libraries are UNALIGNED, you'll need to update the packaging for those libraries, then recompile your app and retest by following the steps in this section.


    What about the libraries that are 
    armeabi-v7a and x86. We do not need to do anything? If not why? Little bit of an explanation would help.


Thanks.

Dan Albert

unread,
Jul 21, 2025, 4:29:39 PMJul 21
to andro...@googlegroups.com, Steven Moreland

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/android-ndk/bc775e84-2196-4af4-927a-b15e0f864882n%40googlegroups.com.

Steven Moreland

unread,
Jul 21, 2025, 4:35:05 PMJul 21
to Dan Albert, andro...@googlegroups.com
32-bit ABIs don't need to be aligned. This is because 32-bit CPUs don't support 16 KB pages.

John Dallman

unread,
Jul 23, 2025, 10:24:12 AMJul 23
to andro...@googlegroups.com
Is it worth adding the explanation that 32-bit libraries only need to be 4KB aligned, but 64-bit libraries should be 16KB-aligned to the Android Changes for NDK Developers page? 

A sample command for checking libraries could also be worth adding there. I use:

llvm-objdump -p $FILE.SO | grep LOAD

4KB is 2**12 alignment, 16KB is 2**14 alignment. 



Reply all
Reply to author
Forward
0 new messages