From a01567f4f7fbbc6ce1492b359c762fcf39e71b4b Mon Sep 17 00:00:00 2001 From: Luis Machado Date: Mon, 1 Nov 2021 17:14:26 -0300 Subject: Enable ARMv8.1-m PACBTI support This set of changes enable support for the ARMv8.1-m PACBTI extensions [1]. The goal of the PACBTI extensions is similar in scope to that of a-profile PAC/BTI (aarch64 only), but the underlying implementation is different. One important difference is that the pointer authentication code is stored in a separate register, thus we don't need to mask/unmask the return address from a function in order to produce a correct backtrace. The patch introduces the following modifications: - Extend the prologue analyser for 32-bit ARM to handle some instructions from ARMv8.1-m PACBTI: pac, aut, pacg, autg and bti. Also keep track of return address signing/authentication instructions. - Adds code to identify object file attributes that indicate the presence of ARMv8.1-m PACBTI (Tag_PAC_extension, Tag_BTI_extension, Tag_PACRET_use and Tag_BTI_use). - Adds support for DWARF pseudo-register RA_AUTH_CODE, as described in the aadwarf32 [2]. - Extends the dwarf unwinder to track the value of RA_AUTH_CODE. - Decorates backtraces with the "[PAC]" identifier when a frame has signed the return address. - Makes GDB aware of a new XML feature "org.gnu.gdb.arm.m-profile-pacbti". This feature is not included as an XML file on GDB's side because it is only supported for bare metal targets. - Additional documentation. [1] https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/armv8-1-m-pointer-authentication-and-branch-target-identification-extension [2] https://github.com/ARM-software/abi-aa/blob/main/aadwarf32/aadwarf32.rst --- gdb/arm-tdep.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gdb/arm-tdep.h') diff --git a/gdb/arm-tdep.h b/gdb/arm-tdep.h index 8a9f618..ae32fff 100644 --- a/gdb/arm-tdep.h +++ b/gdb/arm-tdep.h @@ -119,6 +119,12 @@ struct arm_gdbarch_tdep : gdbarch_tdep int mve_pseudo_base = 0; /* Number of the first MVE pseudo register. */ int mve_pseudo_count = 0; /* Total number of MVE pseudo registers. */ + bool have_pacbti = false; /* True if we have the ARMv8.1-m PACBTI + extensions. */ + int pacbti_pseudo_base = 0; /* Number of the first PACBTI pseudo + register. */ + int pacbti_pseudo_count = 0; /* Total number of PACBTI pseudo registers. */ + bool is_m = false; /* Does the target follow the "M" profile. */ CORE_ADDR lowest_pc = 0; /* Lowest address at which instructions will appear. */ -- cgit v1.1