[PATCH v1 2/4] elf: Allow architectures to provide AT_HWCAP3

Mark Brown broonie at kernel.org
Thu Jun 16 04:18:16 PDT 2022


In order to provide for architectures which have filled both AT_HWCAP and
AT_HWCAP2 add support for AT_HWCAP3.

Signed-off-by: Mark Brown <broonie at kernel.org>
---
 fs/binfmt_elf.c             | 3 +++
 include/uapi/linux/auxvec.h | 1 +
 2 files changed, 4 insertions(+)

diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 63c7ebb0da89..59d937dddc09 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -275,6 +275,9 @@ create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec,
 	NEW_AUX_ENT(AT_RANDOM, (elf_addr_t)(unsigned long)u_rand_bytes);
 #ifdef ELF_HWCAP2
 	NEW_AUX_ENT(AT_HWCAP2, ELF_HWCAP2);
+#endif
+#ifdef ELF_HWCAP3
+	NEW_AUX_ENT(AT_HWCAP3, ELF_HWCAP3);
 #endif
 	NEW_AUX_ENT(AT_EXECFN, bprm->exec);
 	if (k_platform) {
diff --git a/include/uapi/linux/auxvec.h b/include/uapi/linux/auxvec.h
index c7e502bf5a6f..76631c7f9e8f 100644
--- a/include/uapi/linux/auxvec.h
+++ b/include/uapi/linux/auxvec.h
@@ -30,6 +30,7 @@
 				 * differ from AT_PLATFORM. */
 #define AT_RANDOM 25	/* address of 16 random bytes */
 #define AT_HWCAP2 26	/* extension of AT_HWCAP */
+#define AT_HWCAP3 27	/* further extension of AT_HWCAP */
 
 #define AT_EXECFN  31	/* filename of program */
 
-- 
2.30.2




More information about the linux-arm-kernel mailing list