Chandler
Chandler

Reputation: 386

How to check a NDK library info?

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

Answers (1)

Dan Albert
Dan Albert

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

Related Questions