From 0562629fa863a751e04e4a5979c76b1106e467d3 Mon Sep 17 00:00:00 2001 From: Kalesh Singh Date: Wed, 7 Feb 2024 13:23:53 -0800 Subject: [PATCH] toybox: Make readelf aware of NT_ANDROID_TYPE_PAD_SEGMENT Android includes a new note in of type NT_ANDROID_TYPE_PAD_SEGMENT [1], make readelf -n able to decode notes for this type. [1] https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/arch-common/bionic/crt_pad_segment.S Signed-off-by: Kalesh Singh --- toys/other/readelf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/toys/other/readelf.c b/toys/other/readelf.c index 15e5e7d7..19387360 100644 --- a/toys/other/readelf.c +++ b/toys/other/readelf.c @@ -424,6 +424,8 @@ static void show_notes(unsigned long offset, unsigned long size) if (type == 1) { printf("NT_VERSION\tAPI level %u", elf_int(&p)), j=1; if (descsz>=132) printf(", NDK %.64s (%.64s)", p, p+64); + } else if (type == 5) { + printf("NT_PAD_SEGMENT\tpad_segment=%u", elf_int(&p)), j=1; } else p -= 8; } else if (notematch(namesz, &p, "CORE")) { if (*(desc = nt_type_core(type)) != '0') printf("%s", desc), j=1; -- 2.39.2