commit ccd7d9239967faf7aae0da60f64ad71e12c4e5f7
parent d5b65805dcde0bb432b7b4b129c5ab9db81aee36
Author: Drew DeVault <sir@cmpwn.com>
Date: Sun, 11 Apr 2021 09:38:27 -0400
format::elf: improve auxv type
Diffstat:
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/format/elf/types.ha b/format/elf/types.ha
@@ -841,14 +841,18 @@ export type dt = enum i64 {
// Auxillary vector
export type auxv64 = struct {
- a_type: u64, // Entry type
+ // Entry type
+ a_type: at,
union {
- a_val: u64, // Integer value
+ // Integer value
+ a_val: u64,
+ a_ptr: *void,
+ a_fnc: *fn() void,
}
};
// Legal auxillary vector entry types
-export type at = enum u32 {
+export type at = enum u64 {
// End of vector
NULL = 0,
// Entry should be ignored
diff --git a/linux/vdso/vdso.ha b/linux/vdso/vdso.ha
@@ -12,7 +12,7 @@ fn sys_infoehdr() nullable *elf::header64 = {
ehdr_checked = true;
for (let i = 0; linux::auxv[i].a_type != 0; i += 1) {
- if (linux::auxv[i].a_type != elf::at::SYSINFO_EHDR: u64)
+ if (linux::auxv[i].a_type != elf::at::SYSINFO_EHDR)
continue;
ehdr = linux::auxv[i].a_val: uintptr: *elf::header64;
return ehdr;