Reputation: 386
Now I have a NDK shared library. eg: libfoo.so
I want to know which NDK version libfoo.so built with ?
Does NDK have a command or a tool can to this ?
I have tried "file" command, But It seems It did not show any info about NDK.
Upvotes: 1
Views: 1018
Reputation: 10499
There's a notes section in the library that describes this. You can use https://android.googlesource.com/platform/ndk/+/refs/heads/master/parse_elfnote.py to parse it. As an example:
$ ./parse_elfnote.py android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so
----------ABI INFO----------
ABI_ANDROID_API: 21
ABI_NDK_VERSION: r20
ABI_NDK_BUILD_NUMBER: 5594570
Upvotes: 3