git: 9712b5e4b58b - stable/15 - elf_common.h: Add AArch64 Memtag ABI constants

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Sun, 08 Mar 2026 12:56:46 UTC
The branch stable/15 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=9712b5e4b58bc3ff9402413ce7a149c956774263

commit 9712b5e4b58bc3ff9402413ce7a149c956774263
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2026-02-23 21:23:49 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2026-03-08 12:56:35 +0000

    elf_common.h: Add AArch64 Memtag ABI constants
    
    Obtained from the Memtag ABI Extension to ELF for the ArmĀ® 64-bit
    Architecture (AArch64) [1]
    
    [1] https://github.com/ARM-software/abi-aa/blob/main/memtagabielf64/memtagabielf64.rst#dynamic-section
    
    Reviewed by:    andrew
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D55486
    
    (cherry picked from commit d971bc5220f7adb8a2bdfadc8e3ca7ffcf9ca843)
---
 sys/sys/elf_common.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h
index a1d38a827fee..4dfb6890eec7 100644
--- a/sys/sys/elf_common.h
+++ b/sys/sys/elf_common.h
@@ -471,6 +471,9 @@ typedef struct {
 #define	SHT_HIOS		0x6fffffff	/* Last of OS specific semantics */
 #define	SHT_LOPROC		0x70000000	/* reserved range for processor */
 
+#define	SHT_AARCH64_MEMTAG_GLOBALS_STATIC	0x70000007
+#define	SHT_AARCH64_MEMTAG_GLOBALS_DYNAMIC	0x70000008
+
 #define	SHT_ARM_EXIDX		0x70000001	/* Exception index table. */
 #define	SHT_ARM_PREEMPTMAP	0x70000002	/* BPABI DLL dynamic linking
 						   pre-emption map. */
@@ -705,6 +708,11 @@ typedef struct {
 #define	DT_AARCH64_BTI_PLT		0x70000001
 #define	DT_AARCH64_PAC_PLT		0x70000003
 #define	DT_AARCH64_VARIANT_PCS		0x70000005
+#define	DT_AARCH64_MEMTAG_MODE		0x70000009
+#define	DT_AARCH64_MEMTAG_HEAP		0x7000000b
+#define	DT_AARCH64_MEMTAG_STACK		0x7000000c
+#define	DT_AARCH64_MEMTAG_GLOBALS	0x7000000d
+#define	DT_AARCH64_MEMTAG_GLOBALSSZ	0x7000000f
 
 #define	DT_ARM_SYMTABSZ			0x70000001
 #define	DT_ARM_PREEMPTMAP		0x70000002