Skip to content

Commit

Permalink
Use correct page size for Aarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
rocallahan committed Aug 17, 2024
1 parent 09e258f commit 1470c9e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/test/vdso_symbols.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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");
Expand Down

0 comments on commit 1470c9e

Please sign in to comment.