NDK r16 changes the section header of the prebuilt so file.

45 views
Skip to first unread message

Herzhaft

unread,
Nov 22, 2017, 5:21:46 AM11/22/17
to android-ndk
After applying NDK r16, the section header of the prebuilt so file changes when building the application.
In the attached figure, the left is the original, and the right is the file with the section header changed.

Returning the NDK to r15c, removes this issue.
Is it possible to fix this issue by giving options with NDK r16 applied?

Thanks.

Ryan Prichard

unread,
Nov 23, 2017, 9:03:35 AM11/23/17
to andro...@googlegroups.com
I reproduced the reported behavior. An solib built with r15c matches the ES/sh_info behavior on the left, whereas one built with r16 matches the one on the right. If I use r16 ndk-build's PREBUILT_SHARED_LIBRARY on an r15c solib, then ndk-build invokes the binutils strip tool, which converts the section headers to match that on the right.

Questions:
 * What build system are you using? e.g. ndk-build, CMake, Gradle, etc.
 * Is there a particular problem this change is causing?

I would guess that both CMake and Gradle also strip prebuilts using the binutils strip tool packaged in the NDK.

FWIW: In general, I think the section header changes were intentional:
 * ES: For .init_array / .fini_array, an sh_entsize of sizeof(void*) makes more sense than 0. Those sections are tables of pointers.
 * Inf: In the before screenshot, .rel.plt referred to .plt, but afterwards, it refers to .got. Here's a patch on the binutils mailing list that looks related: https://sourceware.org/ml/binutils/2015-03/msg00376.html.

-Ryan


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/525aa639-27de-475f-90bf-7e9f69604cf0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages