kernel: pass AT_PAGESZ on exec

This commit is contained in:
monkuous
2025-11-15 23:19:02 +01:00
parent de3f907f25
commit 4024c42af1
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -27,6 +27,7 @@
#define AT_PHDR 3
#define AT_PHENT 4
#define AT_PHNUM 5
#define AT_PAGESZ 6
#define AT_ENTRY 9
#define AT_SECURE 23
#define AT_EXECFN 31
@@ -43,6 +44,7 @@ typedef struct {
auxv64_t entry;
auxv64_t execfn;
auxv64_t secure;
auxv64_t pagesz;
auxv64_t null;
} auxv64list_t;
+2
View File
@@ -163,11 +163,13 @@ int elf_load(vnode_t *vnode, void *base, void **entry, char **interpreter, auxv6
auxv64->phent.type = AT_PHENT;
auxv64->entry.type = AT_ENTRY;
auxv64->secure.type = AT_SECURE;
auxv64->pagesz.type = AT_PAGESZ;
auxv64->secure.val = 0; // set later by whoever called elf_load
auxv64->phnum.val = header.phcount;
auxv64->phent.val = header.phsize;
auxv64->entry.val = header.entry + (uintptr_t)base;
auxv64->pagesz.val = PAGE_SIZE;
*entry = (void *)(header.entry + (uintptr_t)base);
__assert(header.phsize == sizeof(elfph64_t));