From 737a0edf4d2d52c6c2836ffe24c7143b63498123 Mon Sep 17 00:00:00 2001 From: Georg Kotheimer Date: Mon, 3 Mar 2025 16:41:14 +0100 Subject: Support non-cached entries in getauxval Previously the getauxval implementation was limited to the auxiliary vector entries cached in _dl_auxvt. To also support entries outside of that cached subset, store the start address of the auxiliary vector, and if an uncached entry type is encountered search the entire auxiliary vector. Signed-off-by: Marcus Haehnel --- libc/misc/elf/dl-support.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libc/misc/elf') diff --git a/libc/misc/elf/dl-support.c b/libc/misc/elf/dl-support.c index 81c78fa55..09cbefc18 100644 --- a/libc/misc/elf/dl-support.c +++ b/libc/misc/elf/dl-support.c @@ -33,10 +33,13 @@ size_t _dl_phnum; size_t _dl_pagesize; ElfW(auxv_t) _dl_auxvt[AUX_MAX_AT_ID]; +ElfW(auxv_t) *_dl_auxv_start; void internal_function _dl_aux_init (ElfW(auxv_t) *av); void internal_function _dl_aux_init (ElfW(auxv_t) *av) { + _dl_auxv_start = av; + memset(_dl_auxvt, 0x00, sizeof(_dl_auxvt)); for (; av->a_type != AT_NULL; av++) { -- cgit v1.2.3