From 7a3bb62d82631ff042525b7115d9e03a7329e7be Mon Sep 17 00:00:00 2001 From: Ilya Leoshkevich Date: Thu, 22 Jun 2023 01:03:04 +0200 Subject: [PATCH] gdb: support rseq auxvs Linux kernel commit commit 317c8194e6ae ("rseq: Introduce feature size and alignment ELF auxiliary vector entries") introduced two new auxvs: AT_RSEQ_FEATURE_SIZE and AT_RSEQ_ALIGN. Support them in GDB. This fixes auxv.exp on kernels >= v6.3. Change-Id: I8966c4d5c73eb7b45de6d410a9b28a6628edad2e Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30540 Approved-By: Tom Tromey --- gdb/auxv.c | 4 ++++ include/elf/common.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/gdb/auxv.c b/gdb/auxv.c index 7e3efc54e4b..8cda0b687b4 100644 --- a/gdb/auxv.c +++ b/gdb/auxv.c @@ -495,6 +495,10 @@ default_print_auxv_entry (struct gdbarch *gdbarch, struct ui_file *file, AUXV_FORMAT_STR); TAG (AT_RANDOM, _("Address of 16 random bytes"), AUXV_FORMAT_HEX); TAG (AT_HWCAP2, _("Extension of AT_HWCAP"), AUXV_FORMAT_HEX); + TAG (AT_RSEQ_FEATURE_SIZE, _("rseq supported feature size"), + AUXV_FORMAT_DEC); + TAG (AT_RSEQ_ALIGN, _("rseq allocation alignment"), + AUXV_FORMAT_DEC); TAG (AT_EXECFN, _("File name of executable"), AUXV_FORMAT_STR); TAG (AT_SECURE, _("Boolean, was exec setuid-like?"), AUXV_FORMAT_DEC); TAG (AT_SYSINFO, _("Special system info/entry points"), AUXV_FORMAT_HEX); diff --git a/include/elf/common.h b/include/elf/common.h index 2edfb15efc7..244b13361e5 100644 --- a/include/elf/common.h +++ b/include/elf/common.h @@ -1377,6 +1377,8 @@ may differ from AT_PLATFORM. */ #define AT_RANDOM 25 /* Address of 16 random bytes. */ #define AT_HWCAP2 26 /* Extension of AT_HWCAP. */ +#define AT_RSEQ_FEATURE_SIZE 27 /* rseq supported feature size */ +#define AT_RSEQ_ALIGN 28 /* rseq allocation alignment */ #define AT_EXECFN 31 /* Filename of executable. */ /* Pointer to the global system page used for system calls and other nice things. */ -- 2.39.5