From 1470c9e5b0edc90685b44159aba08bd618681771 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Sat, 17 Aug 2024 23:02:04 +1200 Subject: [PATCH] Use correct page size for Aarch64 --- src/test/vdso_symbols.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/test/vdso_symbols.c b/src/test/vdso_symbols.c index 49131711db2..2d4954ede75 100644 --- a/src/test/vdso_symbols.c +++ b/src/test/vdso_symbols.c @@ -27,6 +27,12 @@ static Shdr* find_section(Ehdr* ehdr, const char* name) { return NULL; } +#ifdef __aarch64__ +#define PRELOAD_LIBRARY_PAGE_SIZE 65536 +#else +#define PRELOAD_LIBRARY_PAGE_SIZE 4096 +#endif + int main(void) { char* vdso = (char*)getauxval(AT_SYSINFO_EHDR); Ehdr* ehdr = (Ehdr*)vdso; @@ -39,8 +45,8 @@ int main(void) { for (int si = 0; si*dynsym->sh_entsize < dynsym->sh_size; ++si) { Sym* sym = (Sym*)(vdso + dynsym->sh_offset) + si; // All symbols must be within the VDSO size, i.e. not the - // absolute address. We assume the VDSO is less than 64K. - test_assert(sym->st_value < 0x10000); + // absolute address. We assume the VDSO is less than 4 pages. + test_assert(sym->st_value < 4*PRELOAD_LIBRARY_PAGE_SIZE); } atomic_puts("EXIT-SUCCESS");