[Morello] Teach gdb about additional CHERI auxv entries
CHERI/Morello defines some new auxv entries. Make sure gdb understands
their type, even though gdb doesn't know how to display the capabilities
themselves.
diff --git a/gdb/auxv.c b/gdb/auxv.c
index 87fc01d..ed29007 100644
--- a/gdb/auxv.c
+++ b/gdb/auxv.c
@@ -540,6 +540,28 @@
AUXV_FORMAT_HEX);
TAG (AT_SUN_CAP_HW2, _("Machine-dependent CPU capability hints 2"),
AUXV_FORMAT_HEX);
+
+ /* CHERI-specific auxv entries. */
+ TAG (AT_CHERI_EXEC_RW_CAP,
+ _("The executable's RW region capability, if it exists"),
+ AUXV_FORMAT_HEX);
+ TAG (AT_CHERI_EXEC_RX_CAP, _("The executable's RX capability"),
+ AUXV_FORMAT_HEX);
+ TAG (AT_CHERI_INTERP_RW_CAP,
+ _("The interpreter's RW region capability, if it exists"),
+ AUXV_FORMAT_HEX);
+ TAG (AT_CHERI_INTERP_RX_CAP, _("The interpreter's RX region capability"),
+ AUXV_FORMAT_HEX);
+ TAG (AT_CHERI_STACK_CAP, _("The stack capability"), AUXV_FORMAT_HEX);
+ TAG (AT_CHERI_SEAL_CAP, _("The root sealing capability"),
+ AUXV_FORMAT_HEX);
+ TAG (AT_CHERI_CID_CAP, _("The root CID capability"), AUXV_FORMAT_HEX);
+ TAG (AT_ARGC, _("The number of initial arguments"), AUXV_FORMAT_DEC);
+ TAG (AT_ARGV, _("Capability to the initial arguments"), AUXV_FORMAT_HEX);
+ TAG (AT_ENVC, _("The number of initial environment variable entries"),
+ AUXV_FORMAT_DEC);
+ TAG (AT_ENVP, _("Capability to the initial environment variables"),
+ AUXV_FORMAT_HEX);
}
fprint_auxv_entry (file, name, description, format, type, val);
diff --git a/include/elf/common.h b/include/elf/common.h
index c6a31cc..edd864e 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -1325,4 +1325,17 @@
#define AT_SUN_BRAND_AUX3 2022
#define AT_SUN_CAP_HW2 2023 /* Extension of AT_SUN_CAP_HW1. */
+/* CHERI auxv types. */
+#define AT_CHERI_EXEC_RW_CAP 60
+#define AT_CHERI_EXEC_RX_CAP 61
+#define AT_CHERI_INTERP_RW_CAP 62
+#define AT_CHERI_INTERP_RX_CAP 63
+#define AT_CHERI_STACK_CAP 64
+#define AT_CHERI_SEAL_CAP 65
+#define AT_CHERI_CID_CAP 66
+#define AT_ARGC 80
+#define AT_ARGV 81
+#define AT_ENVC 82
+#define AT_ENVP 83
+
#endif /* _ELF_COMMON_H */