Skip to content

Commit 253e562

Browse files
author
Tianjie Xu
committed
Add elf note containing ndk version info
Add a ndk_version field in the c struct. Bug: None Change-Id: Ia9a2fba388217f659dfc116b8e58f71e449a001d
1 parent 4449cf8 commit 253e562

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ndk/platforms/common/src/crtbrand.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ typedef int int32_t[sizeof(int) == 4];
3636
#define ABI_SECTION ".note.android.ident"
3737
#define ABI_NOTETYPE 1
3838
#define ABI_ANDROID_API PLATFORM_SDK_VERSION
39+
#define ABI_NDK_VERSION "%NDK_VERSION%"
40+
#define ABI_NDK_BUILD_NUMBER "%NDK_BUILD_NUMBER%"
41+
42+
#define NDK_RESERVED_SIZE 64
3943

4044
#define L 9999
4145

@@ -63,10 +67,14 @@ static const struct {
6367
int32_t type;
6468
char name[sizeof ABI_VENDOR];
6569
int32_t android_api;
70+
char ndk_version[NDK_RESERVED_SIZE];
71+
char ndk_build_number[NDK_RESERVED_SIZE];
6672
} abitag __attribute__ ((section (ABI_SECTION), aligned(4), used)) = {
6773
sizeof ABI_VENDOR,
6874
sizeof(int32_t),
6975
ABI_NOTETYPE,
7076
ABI_VENDOR,
7177
ABI_ANDROID_API,
78+
ABI_NDK_VERSION,
79+
ABI_NDK_BUILD_NUMBER,
7280
};

0 commit comments

Comments
 (0)