@@ -1,3 +1,8 @@
+2011-03-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/morestack.S: Properly save the x32 new stack
+ boundary.
+
2011-02-14 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/morestack.S: Replace __LP64___ with __LP64__.
@@ -354,7 +354,11 @@ __morestack:
# FIXME: The offset must match
# TARGET_THREAD_SPLIT_STACK_OFFSET in
# gcc/config/i386/linux64.h.
+#ifdef __LP64__
movq %rax,%fs:0x70 # Save the new stack boundary.
+#else
+ movl %eax,%fs:0x40 # Save the new stack boundary.
+#endif
call __morestack_unblock_signals
@@ -392,7 +396,11 @@ __morestack:
subq 0(%rsp),%rax # Subtract available space.
addq $BACKOFF,%rax # Back off 1024 bytes.
.LEHE0:
+#ifdef __LP64__
movq %rax,%fs:0x70 # Save the new stack boundary.
+#else
+ movl %eax,%fs:0x40 # Save the new stack boundary.
+#endif
addq $16,%rsp # Remove values from stack.
@@ -434,7 +442,11 @@ __morestack:
movq %rbp,%rcx # Get the stack pointer.
subq %rax,%rcx # Subtract available space.
addq $BACKOFF,%rcx # Back off 1024 bytes.
+#ifdef __LP64__
movq %rcx,%fs:0x70 # Save new stack boundary.
+#else
+ movl %ecx,%fs:0x40 # Save new stack boundary.
+#endif
movq (%rsp),%rdi # Restore exception data for call.
#ifdef __PIC__
call _Unwind_Resume@PLT # Resume unwinding.
@@ -554,7 +566,11 @@ __stack_split_initialize:
#else /* defined(__x86_64__) */
leaq -16000(%rsp),%rax # We should have at least 16K.
+#ifdef __LP64__
movq %rax,%fs:0x70
+#else
+ movl %eax,%fs:0x40
+#endif
movq %rsp,%rdi
movq $16000,%rsi
#ifdef __PIC__