aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2021-04-14 14:22:44 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2021-04-14 14:22:44 +0000
commitd5c137cf529398b9bd7ea1c34605aa4b735b8b11 (patch)
tree560a4eda2ca71f0f18a2b372265e80504b6ae82a
parent666c20f65ebe79576949e989640d938928daad05 (diff)
downloadbinutils-d5c137cf529398b9bd7ea1c34605aa4b735b8b11.zip
binutils-d5c137cf529398b9bd7ea1c34605aa4b735b8b11.tar.gz
binutils-d5c137cf529398b9bd7ea1c34605aa4b735b8b11.tar.bz2
ARM/FDPIC: Add support to unwind thumb2 signal trampoline
2021-04-14 Mickael Guene <mickael.guene@st.com> Christophe Lyon <christophe.lyon@st.com> * gdb/arm-linux-tdep.c (FDPIC_T2_LDR_R12_WITH_FUNCDESC): New define. (FDPIC_T2_LDR_R9_WITH_GOT): New define. (FDPIC_T2_LDR_PC_WITH_RESTORER): New define. (arm_linux_thumb2_sigreturn_tramp_frame_fdpic): New. (arm_linux_init_abi): Add thumb2 signal handler.
-rw-r--r--gdb/arm-linux-tdep.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 3da1011..4ec4561 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -257,6 +257,10 @@ static const char arm_linux_thumb2_le_breakpoint[] = { 0xf0, 0xf7, 0x00, 0xa0 };
#define FDPIC_LDR_R9_WITH_GOT 0xe59c9004
#define FDPIC_LDR_PC_WITH_RESTORER 0xe59cf000
+#define FDPIC_T2_LDR_R12_WITH_FUNCDESC 0xc008f8df
+#define FDPIC_T2_LDR_R9_WITH_GOT 0x9004f8dc
+#define FDPIC_T2_LDR_PC_WITH_RESTORER 0xf000f8dc
+
static void
arm_linux_sigtramp_cache (struct frame_info *this_frame,
struct trad_frame_cache *this_cache,
@@ -511,6 +515,18 @@ static struct tramp_frame arm_linux_sigreturn_tramp_frame_fdpic = {
arm_linux_sigreturn_fdpic_init
};
+static struct tramp_frame arm_linux_thumb2_sigreturn_tramp_frame_fdpic = {
+ SIGTRAMP_FRAME,
+ 4,
+ {
+ { FDPIC_T2_LDR_R12_WITH_FUNCDESC, -1 },
+ { FDPIC_T2_LDR_R9_WITH_GOT, -1 },
+ { FDPIC_T2_LDR_PC_WITH_RESTORER, -1 },
+ { TRAMP_SENTINEL_INSN }
+ },
+ arm_linux_sigreturn_fdpic_init
+};
+
/* Core file and register set support. */
#define ARM_LINUX_SIZEOF_GREGSET (18 * INT_REGISTER_SIZE)
@@ -1312,6 +1328,8 @@ arm_linux_init_abi (struct gdbarch_info info,
&arm_kernel_linux_restart_syscall_tramp_frame);
tramp_frame_prepend_unwinder (gdbarch,
&arm_linux_sigreturn_tramp_frame_fdpic);
+ tramp_frame_prepend_unwinder (gdbarch,
+ &arm_linux_thumb2_sigreturn_tramp_frame_fdpic);
/* Core file support. */
set_gdbarch_regset_from_core_section (gdbarch,