public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] work around gcc4 issue with -Os in Dwarf2 stack unwind code
@ 2006-11-28 14:12 Jan Beulich
  2006-11-28 14:32 ` Jakub Jelinek
  2006-11-28 16:23 ` Andi Kleen
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Beulich @ 2006-11-28 14:12 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

This fixes a problem with gcc4 mis-compiling the stack unwind code under
-Os, which resulted in 'stuck' messages whenever an assembly routine was
encountered.

(The second hunk is trivial cleanup.)

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- linux-2.6.19-rc6/kernel/unwind.c	2006-11-22 14:54:10.000000000 +0100
+++ 2.6.19-rc6-unwind-stuck/kernel/unwind.c	2006-11-28 15:02:15.000000000 +0100
@@ -938,8 +938,11 @@ int unwind(struct unwind_frame_info *fra
 		else {
 			retAddrReg = state.version <= 1 ? *ptr++ : get_uleb128(&ptr, end);
 			/* skip augmentation */
-			if (((const char *)(cie + 2))[1] == 'z')
-				ptr += get_uleb128(&ptr, end);
+			if (((const char *)(cie + 2))[1] == 'z') {
+				uleb128_t augSize = get_uleb128(&ptr, end);
+
+				ptr += augSize;
+			}
 			if (ptr > end
 			   || retAddrReg >= ARRAY_SIZE(reg_info)
 			   || REG_INVALID(retAddrReg)
@@ -963,9 +966,7 @@ int unwind(struct unwind_frame_info *fra
 	if (cie == NULL || fde == NULL) {
 #ifdef CONFIG_FRAME_POINTER
 		unsigned long top, bottom;
-#endif
 
-#ifdef CONFIG_FRAME_POINTER
 		top = STACK_TOP(frame->task);
 		bottom = STACK_BOTTOM(frame->task);
 # if FRAME_RETADDR_OFFSET < 0



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-11-28 16:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-28 14:12 [PATCH] work around gcc4 issue with -Os in Dwarf2 stack unwind code Jan Beulich
2006-11-28 14:32 ` Jakub Jelinek
2006-11-28 14:48   ` Jan Beulich
2006-11-28 14:59     ` Jakub Jelinek
2006-11-28 16:23 ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox