Skip to content

Commit 89e6209

Browse files
Treehugger RobotGerrit Code Review
authored andcommitted
Merge "Add elf note containing ndk version info"
2 parents 4449cf8 + 253e562 commit 89e6209

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)