Commit ff0a538d authored by Jan Beulich's avatar Jan Beulich Committed by Andi Kleen

[PATCH] x86-64: work around gcc4 issue with -Os in Dwarf2 stack unwind

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: default avatarJan Beulich <jbeulich@novell.com>
parent a3550a9c
...@@ -938,8 +938,11 @@ int unwind(struct unwind_frame_info *frame) ...@@ -938,8 +938,11 @@ int unwind(struct unwind_frame_info *frame)
else { else {
retAddrReg = state.version <= 1 ? *ptr++ : get_uleb128(&ptr, end); retAddrReg = state.version <= 1 ? *ptr++ : get_uleb128(&ptr, end);
/* skip augmentation */ /* skip augmentation */
if (((const char *)(cie + 2))[1] == 'z') if (((const char *)(cie + 2))[1] == 'z') {
ptr += get_uleb128(&ptr, end); uleb128_t augSize = get_uleb128(&ptr, end);
ptr += augSize;
}
if (ptr > end if (ptr > end
|| retAddrReg >= ARRAY_SIZE(reg_info) || retAddrReg >= ARRAY_SIZE(reg_info)
|| REG_INVALID(retAddrReg) || REG_INVALID(retAddrReg)
...@@ -963,9 +966,7 @@ int unwind(struct unwind_frame_info *frame) ...@@ -963,9 +966,7 @@ int unwind(struct unwind_frame_info *frame)
if (cie == NULL || fde == NULL) { if (cie == NULL || fde == NULL) {
#ifdef CONFIG_FRAME_POINTER #ifdef CONFIG_FRAME_POINTER
unsigned long top, bottom; unsigned long top, bottom;
#endif
#ifdef CONFIG_FRAME_POINTER
top = STACK_TOP(frame->task); top = STACK_TOP(frame->task);
bottom = STACK_BOTTOM(frame->task); bottom = STACK_BOTTOM(frame->task);
# if FRAME_RETADDR_OFFSET < 0 # if FRAME_RETADDR_OFFSET < 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment