mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
kernel: pass AT_PAGESZ on exec
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user