From: Christophe Lyon Date: Wed, 14 Apr 2021 14:22:44 +0000 (+0000) Subject: ARM/FDPIC: Add support to unwind thumb2 signal trampoline X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d5c137cf529398b9bd7ea1c34605aa4b735b8b11;p=thirdparty%2Fbinutils-gdb.git ARM/FDPIC: Add support to unwind thumb2 signal trampoline 2021-04-14 Mickael Guene Christophe Lyon * 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. --- diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index 3da10112eb5..4ec4561cf72 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,