aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis Machado <luis.machado@arm.com>2023-08-11 09:45:44 +0100
committerLuis Machado <luis.machado@arm.com>2023-08-11 11:32:02 +0100
commit690199d5d4180f287074f2976a12d2df1e415d67 (patch)
tree01b56a5d3640c1e6030ceeaf60194ee1f2d551c2
parente4c78b3b86fd2148c37d1870cf8bd663f49d4fe0 (diff)
downloadgdb-690199d5d4180f287074f2976a12d2df1e415d67.zip
gdb-690199d5d4180f287074f2976a12d2df1e415d67.tar.gz
gdb-690199d5d4180f287074f2976a12d2df1e415d67.tar.bz2
[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.
-rw-r--r--gdb/auxv.c22
-rw-r--r--include/elf/common.h13
2 files changed, 35 insertions, 0 deletions
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 @@ default_print_auxv_entry (struct gdbarch *gdbarch, struct ui_file *file,
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 */