From: jca Date: Sun, 14 Jul 2024 11:14:29 +0000 (+0000) Subject: Actually set up hwcap AUX_* entries when available X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=242b8fde7751fdd8f82a116bcc742baadaf520f0;p=openbsd Actually set up hwcap AUX_* entries when available Erroneously dropped from the last elf_aux_info(3) diff I sent on tech@. Lack of this chunk would affect arm64 and riscv64 as they're the two architectures providing hwcap*. Should have been ok kettenis@ --- diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c index 0cb3b15968f..18398d887f5 100644 --- a/sys/kern/exec_elf.c +++ b/sys/kern/exec_elf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_elf.c,v 1.186 2024/04/02 08:39:16 deraadt Exp $ */ +/* $OpenBSD: exec_elf.c,v 1.187 2024/07/14 11:14:29 jca Exp $ */ /* * Copyright (c) 1996 Per Fogelstrom @@ -89,6 +89,7 @@ #include #include +#include int elf_load_file(struct proc *, char *, struct exec_package *, struct elf_args *); @@ -995,6 +996,18 @@ exec_elf_fixup(struct proc *p, struct exec_package *epp) a->au_v = ap->arg_entry; a++; +#ifdef __HAVE_CPU_HWCAP + a->au_id = AUX_hwcap; + a->au_v = hwcap; + a++; +#endif /* __HAVE_CPU_HWCAP */ + +#ifdef __HAVE_CPU_HWCAP2 + a->au_id = AUX_hwcap2; + a->au_v = hwcap2; + a++; +#endif /* __HAVE_CPU_HWCAP2 */ + a->au_id = AUX_openbsd_timekeep; a->au_v = p->p_p->ps_timekeep; a++;