This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Fix overly strict check in arm_skip_stack_protector
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Cc: yao at codesourcery dot com
- Date: Thu, 3 Feb 2011 19:36:56 +0100 (CET)
- Subject: [commit] Fix overly strict check in arm_skip_stack_protector
Hello,
the stack protector skipping code didn't work for me because the stack
guard symbol is named __stack_chk_guard@@GLIBC_2.4, but the check in
arm_skip_stack_protector only accepts __stack_chk_guard.
Note that the comment already suggests that any symbol whose name *starts*
with __stack_chk_guard ought to be accepted, so I'm simply changing the
code to match the comment.
Tested on armv7l-linux-gnueabi, fixes all gdb.mi/gdb792.exp failures.
Committed to mainline.
Bye,
Ulrich
ChangeLog:
* arm-tdep.c (arm_skip_stack_protector): Accept any symbol that
starts with __stack_chk_guard as stack guard symbol.
diff -urNp gdb-orig/gdb/arm-tdep.c gdb-head/gdb/arm-tdep.c
--- gdb-orig/gdb/arm-tdep.c 2011-02-02 19:44:56.000000000 +0000
+++ gdb-head/gdb/arm-tdep.c 2011-02-03 17:52:22.000000000 +0000
@@ -1296,7 +1296,8 @@ arm_skip_stack_protector(CORE_ADDR pc, s
instruction sequence is not for stack protector. If symbol is
removed, we conservatively think this sequence is for stack protector. */
if (stack_chk_guard
- && strcmp (SYMBOL_LINKAGE_NAME(stack_chk_guard), "__stack_chk_guard"))
+ && strncmp (SYMBOL_LINKAGE_NAME (stack_chk_guard), "__stack_chk_guard",
+ strlen ("__stack_chk_guard")) != 0)
return pc;
if (is_thumb)
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com