|
|
5de29b |
# commit 8b8a692cfd7d80f1ee7c8b9ab356a259367dd187
|
|
|
5de29b |
# Author: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
|
|
|
5de29b |
# Date: Wed Dec 4 06:55:03 2013 -0600
|
|
|
5de29b |
#
|
|
|
5de29b |
# PowerPC64 ELFv2 ABI 4/6: Stack frame layout changes
|
|
|
5de29b |
#
|
|
|
5de29b |
# This updates glibc for the changes in the ELFv2 relating to the
|
|
|
5de29b |
# stack frame layout. These are described in more detail here:
|
|
|
5de29b |
# http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01149.html
|
|
|
5de29b |
# http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01146.html
|
|
|
5de29b |
#
|
|
|
5de29b |
# Specifically, the "compiler and linker doublewords" were removed,
|
|
|
5de29b |
# which has the effect that the save slot for the TOC register is
|
|
|
5de29b |
# now at offset 24 rather than 40 to the stack pointer.
|
|
|
5de29b |
#
|
|
|
5de29b |
# In addition, a function may now no longer necessarily assume that
|
|
|
5de29b |
# its caller has set up a 64-byte register save area its use.
|
|
|
5de29b |
#
|
|
|
5de29b |
# To address the first change, the patch goes through all assembler
|
|
|
5de29b |
# files and replaces immediate offsets in instructions accessing the
|
|
|
5de29b |
# ABI-defined stack slots by symbolic offsets. Those already were
|
|
|
5de29b |
# defined in ucontext_i.sym and used in some of the context routines,
|
|
|
5de29b |
# but that doesn't really seem like the right place for those defines.
|
|
|
5de29b |
#
|
|
|
5de29b |
# The patch instead defines those symbolic offsets in sysdeps.h,
|
|
|
5de29b |
# in two variants for the old and new ABI, and uses them systematically
|
|
|
5de29b |
# in all assembler files, not just the context routines.
|
|
|
5de29b |
#
|
|
|
5de29b |
# The second change only affected a few assembler files that used
|
|
|
5de29b |
# the save area to temporarily store some registers. In those
|
|
|
5de29b |
# cases where this happens within a leaf function, this patch
|
|
|
5de29b |
# changes the code to store those registers to the "red zone"
|
|
|
5de29b |
# below the stack pointer. Otherwise, the functions already allocate
|
|
|
5de29b |
# a stack frame, and the patch changes them to add extra space in
|
|
|
5de29b |
# these frames as temporary space for the ELFv2 ABI.
|
|
|
5de29b |
#
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
|
|
|
12745e |
--- glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h 2014-05-29 14:10:00.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h 2014-05-29 14:10:00.000000000 -0500
|
|
|
5de29b |
@@ -31,6 +31,14 @@
|
|
|
5de29b |
# define DASHDASHPFX(str) __##str
|
|
|
5de29b |
# endif
|
|
|
5de29b |
|
|
|
5de29b |
+#if _CALL_ELF == 2
|
|
|
5de29b |
+#define CANCEL_FRAMESIZE (FRAME_MIN_SIZE+16+48)
|
|
|
5de29b |
+#define CANCEL_PARM_SAVE (FRAME_MIN_SIZE+16)
|
|
|
5de29b |
+#else
|
|
|
5de29b |
+#define CANCEL_FRAMESIZE (FRAME_MIN_SIZE+16)
|
|
|
5de29b |
+#define CANCEL_PARM_SAVE (CANCEL_FRAMESIZE+FRAME_PARM_SAVE)
|
|
|
5de29b |
+#endif
|
|
|
5de29b |
+
|
|
|
5de29b |
# undef PSEUDO
|
|
|
5de29b |
# define PSEUDO(name, syscall_name, args) \
|
|
|
5de29b |
.section ".text"; \
|
|
|
5de29b |
@@ -44,52 +52,52 @@
|
|
|
5de29b |
PSEUDO_RET; \
|
|
|
5de29b |
.size DASHDASHPFX(syscall_name##_nocancel),.-DASHDASHPFX(syscall_name##_nocancel); \
|
|
|
5de29b |
.Lpseudo_cancel: \
|
|
|
5de29b |
- stdu 1,-128(1); \
|
|
|
5de29b |
- cfi_adjust_cfa_offset (128); \
|
|
|
5de29b |
+ stdu 1,-CANCEL_FRAMESIZE(1); \
|
|
|
5de29b |
+ cfi_adjust_cfa_offset (CANCEL_FRAMESIZE); \
|
|
|
5de29b |
mflr 9; \
|
|
|
5de29b |
- std 9,128+16(1); \
|
|
|
5de29b |
- cfi_offset (lr, 16); \
|
|
|
5de29b |
+ std 9,CANCEL_FRAMESIZE+FRAME_LR_SAVE(1); \
|
|
|
5de29b |
+ cfi_offset (lr, FRAME_LR_SAVE); \
|
|
|
5de29b |
DOCARGS_##args; /* save syscall args around CENABLE. */ \
|
|
|
5de29b |
CENABLE; \
|
|
|
5de29b |
- std 3,112(1); /* store CENABLE return value (MASK). */ \
|
|
|
5de29b |
+ std 3,FRAME_MIN_SIZE(1); /* store CENABLE return value (MASK). */ \
|
|
|
5de29b |
UNDOCARGS_##args; /* restore syscall args. */ \
|
|
|
5de29b |
DO_CALL (SYS_ify (syscall_name)); \
|
|
|
5de29b |
mfcr 0; /* save CR/R3 around CDISABLE. */ \
|
|
|
5de29b |
- std 3,120(1); \
|
|
|
5de29b |
- std 0,128+8(1); \
|
|
|
5de29b |
- cfi_offset (cr, 8); \
|
|
|
5de29b |
- ld 3,112(1); /* pass MASK to CDISABLE. */ \
|
|
|
5de29b |
+ std 3,FRAME_MIN_SIZE+8(1); \
|
|
|
5de29b |
+ std 0,CANCEL_FRAMESIZE+FRAME_CR_SAVE(1); \
|
|
|
5de29b |
+ cfi_offset (cr, FRAME_CR_SAVE); \
|
|
|
5de29b |
+ ld 3,FRAME_MIN_SIZE(1); /* pass MASK to CDISABLE. */ \
|
|
|
5de29b |
CDISABLE; \
|
|
|
5de29b |
- ld 9,128+16(1); \
|
|
|
5de29b |
- ld 0,128+8(1); /* restore CR/R3. */ \
|
|
|
5de29b |
- ld 3,120(1); \
|
|
|
5de29b |
+ ld 9,CANCEL_FRAMESIZE+FRAME_LR_SAVE(1); \
|
|
|
5de29b |
+ ld 0,CANCEL_FRAMESIZE+FRAME_CR_SAVE(1); /* restore CR/R3. */ \
|
|
|
5de29b |
+ ld 3,FRAME_MIN_SIZE+8(1); \
|
|
|
5de29b |
mtlr 9; \
|
|
|
5de29b |
mtcr 0; \
|
|
|
5de29b |
- addi 1,1,128; \
|
|
|
5de29b |
- cfi_adjust_cfa_offset (-128); \
|
|
|
5de29b |
+ addi 1,1,CANCEL_FRAMESIZE; \
|
|
|
5de29b |
+ cfi_adjust_cfa_offset (-CANCEL_FRAMESIZE); \
|
|
|
5de29b |
cfi_restore (lr); \
|
|
|
5de29b |
cfi_restore (cr)
|
|
|
5de29b |
|
|
|
5de29b |
# define DOCARGS_0
|
|
|
5de29b |
# define UNDOCARGS_0
|
|
|
5de29b |
|
|
|
5de29b |
-# define DOCARGS_1 std 3,128+48(1); DOCARGS_0
|
|
|
5de29b |
-# define UNDOCARGS_1 ld 3,128+48(1); UNDOCARGS_0
|
|
|
5de29b |
+# define DOCARGS_1 std 3,CANCEL_PARM_SAVE(1); DOCARGS_0
|
|
|
5de29b |
+# define UNDOCARGS_1 ld 3,CANCEL_PARM_SAVE(1); UNDOCARGS_0
|
|
|
5de29b |
|
|
|
5de29b |
-# define DOCARGS_2 std 4,128+56(1); DOCARGS_1
|
|
|
5de29b |
-# define UNDOCARGS_2 ld 4,128+56(1); UNDOCARGS_1
|
|
|
5de29b |
+# define DOCARGS_2 std 4,CANCEL_PARM_SAVE+8(1); DOCARGS_1
|
|
|
5de29b |
+# define UNDOCARGS_2 ld 4,CANCEL_PARM_SAVE+8(1); UNDOCARGS_1
|
|
|
5de29b |
|
|
|
5de29b |
-# define DOCARGS_3 std 5,128+64(1); DOCARGS_2
|
|
|
5de29b |
-# define UNDOCARGS_3 ld 5,128+64(1); UNDOCARGS_2
|
|
|
5de29b |
+# define DOCARGS_3 std 5,CANCEL_PARM_SAVE+16(1); DOCARGS_2
|
|
|
5de29b |
+# define UNDOCARGS_3 ld 5,CANCEL_PARM_SAVE+16(1); UNDOCARGS_2
|
|
|
5de29b |
|
|
|
5de29b |
-# define DOCARGS_4 std 6,128+72(1); DOCARGS_3
|
|
|
5de29b |
-# define UNDOCARGS_4 ld 6,128+72(1); UNDOCARGS_3
|
|
|
5de29b |
+# define DOCARGS_4 std 6,CANCEL_PARM_SAVE+24(1); DOCARGS_3
|
|
|
5de29b |
+# define UNDOCARGS_4 ld 6,CANCEL_PARM_SAVE+24(1); UNDOCARGS_3
|
|
|
5de29b |
|
|
|
5de29b |
-# define DOCARGS_5 std 7,128+80(1); DOCARGS_4
|
|
|
5de29b |
-# define UNDOCARGS_5 ld 7,128+80(1); UNDOCARGS_4
|
|
|
5de29b |
+# define DOCARGS_5 std 7,CANCEL_PARM_SAVE+32(1); DOCARGS_4
|
|
|
5de29b |
+# define UNDOCARGS_5 ld 7,CANCEL_PARM_SAVE+32(1); UNDOCARGS_4
|
|
|
5de29b |
|
|
|
5de29b |
-# define DOCARGS_6 std 8,128+88(1); DOCARGS_5
|
|
|
5de29b |
-# define UNDOCARGS_6 ld 8,128+88(1); UNDOCARGS_5
|
|
|
5de29b |
+# define DOCARGS_6 std 8,CANCEL_PARM_SAVE+40(1); DOCARGS_5
|
|
|
5de29b |
+# define UNDOCARGS_6 ld 8,CANCEL_PARM_SAVE+40(1); UNDOCARGS_5
|
|
|
5de29b |
|
|
|
5de29b |
# ifdef IS_IN_libpthread
|
|
|
5de29b |
# ifdef SHARED
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S 2014-05-29 14:09:56.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S 2014-05-29 14:10:00.000000000 -0500
|
|
|
5de29b |
@@ -133,7 +133,7 @@
|
|
|
5de29b |
ld r14,((JB_GPRS+0)*8)(r3)
|
|
|
5de29b |
lfd fp14,((JB_FPRS+0)*8)(r3)
|
|
|
5de29b |
#if defined SHARED && !defined IS_IN_rtld
|
|
|
5de29b |
- std r2,40(r1) /* Restore the callers TOC save area. */
|
|
|
5de29b |
+ std r2,FRAME_TOC_SAVE(r1) /* Restore the callers TOC save area. */
|
|
|
5de29b |
#endif
|
|
|
5de29b |
ld r15,((JB_GPRS+1)*8)(r3)
|
|
|
5de29b |
lfd fp15,((JB_FPRS+1)*8)(r3)
|
|
|
5de29b |
@@ -151,7 +151,7 @@
|
|
|
5de29b |
PTR_DEMANGLE2 (r0, r25)
|
|
|
5de29b |
#endif
|
|
|
5de29b |
mtlr r0
|
|
|
5de29b |
-/* std r2,40(r1) Restore the TOC save area. */
|
|
|
5de29b |
+/* std r2,FRAME_TOC_SAVE(r1) Restore the TOC save area. */
|
|
|
5de29b |
ld r21,((JB_GPRS+7)*8)(r3)
|
|
|
5de29b |
lfd fp21,((JB_FPRS+7)*8)(r3)
|
|
|
5de29b |
ld r22,((JB_GPRS+8)*8)(r3)
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S 2014-05-29 14:09:56.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S 2014-05-29 14:10:00.000000000 -0500
|
|
|
5de29b |
@@ -66,8 +66,8 @@
|
|
|
5de29b |
BODY_LABEL (_init):
|
|
|
5de29b |
LOCALENTRY(_init)
|
|
|
5de29b |
mflr 0
|
|
|
5de29b |
- std 0, 16(r1)
|
|
|
5de29b |
- stdu r1, -112(r1)
|
|
|
5de29b |
+ std 0, FRAME_LR_SAVE(r1)
|
|
|
5de29b |
+ stdu r1, -FRAME_MIN_SIZE_PARM(r1)
|
|
|
5de29b |
#if PREINIT_FUNCTION_WEAK
|
|
|
5de29b |
addis r9, r2, .LC0@toc@ha
|
|
|
5de29b |
ld r0, .LC0@toc@l(r9)
|
|
|
5de29b |
@@ -84,5 +84,5 @@
|
|
|
5de29b |
BODY_LABEL (_fini):
|
|
|
5de29b |
LOCALENTRY(_fini)
|
|
|
5de29b |
mflr 0
|
|
|
5de29b |
- std 0, 16(r1)
|
|
|
5de29b |
- stdu r1, -112(r1)
|
|
|
5de29b |
+ std 0, FRAME_LR_SAVE(r1)
|
|
|
5de29b |
+ stdu r1, -FRAME_MIN_SIZE_PARM(r1)
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crtn.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crtn.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crtn.S 2014-05-29 14:09:56.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crtn.S 2014-05-29 14:10:00.000000000 -0500
|
|
|
5de29b |
@@ -39,13 +39,13 @@
|
|
|
5de29b |
#include <sysdep.h>
|
|
|
5de29b |
|
|
|
5de29b |
.section .init,"ax",@progbits
|
|
|
5de29b |
- addi r1, r1, 112
|
|
|
5de29b |
- ld r0, 16(r1)
|
|
|
5de29b |
+ addi r1, r1, FRAME_MIN_SIZE_PARM
|
|
|
5de29b |
+ ld r0, FRAME_LR_SAVE(r1)
|
|
|
5de29b |
mtlr r0
|
|
|
5de29b |
blr
|
|
|
5de29b |
|
|
|
5de29b |
.section .fini,"ax",@progbits
|
|
|
5de29b |
- addi r1, r1, 112
|
|
|
5de29b |
- ld r0, 16(r1)
|
|
|
5de29b |
+ addi r1, r1, FRAME_MIN_SIZE_PARM
|
|
|
5de29b |
+ ld r0, FRAME_LR_SAVE(r1)
|
|
|
5de29b |
mtlr r0
|
|
|
5de29b |
blr
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 14:09:56.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 14:10:00.000000000 -0500
|
|
|
5de29b |
@@ -26,13 +26,13 @@
|
|
|
5de29b |
parm1 (r3) and the index (r0) need to be converted to an offset
|
|
|
5de29b |
(index * 24) in parm2 (r4). */
|
|
|
5de29b |
|
|
|
5de29b |
-#define FRAME_SIZE 176
|
|
|
5de29b |
+#define FRAME_SIZE (FRAME_MIN_SIZE+64)
|
|
|
5de29b |
/* We need to save the registers used to pass parameters, ie. r3 thru
|
|
|
5de29b |
r10; Use local var space rather than the parameter save area,
|
|
|
5de29b |
because gcc as of 2010/05 doesn't allocate a proper stack frame for
|
|
|
5de29b |
a function that makes no calls except for __tls_get_addr and we
|
|
|
5de29b |
might be here resolving the __tls_get_addr call. */
|
|
|
5de29b |
-#define INT_PARMS 112
|
|
|
5de29b |
+#define INT_PARMS FRAME_MIN_SIZE
|
|
|
5de29b |
EALIGN(_dl_runtime_resolve, 4, 0)
|
|
|
5de29b |
stdu r1,-FRAME_SIZE(r1)
|
|
|
5de29b |
cfi_adjust_cfa_offset (FRAME_SIZE)
|
|
|
5de29b |
@@ -48,25 +48,25 @@
|
|
|
5de29b |
mflr r0
|
|
|
5de29b |
std r8,INT_PARMS+40(r1)
|
|
|
5de29b |
/* Store the LR in the LR Save area. */
|
|
|
5de29b |
- std r0,FRAME_SIZE+16(r1)
|
|
|
5de29b |
- cfi_offset (lr, 16)
|
|
|
5de29b |
+ std r0,FRAME_SIZE+FRAME_LR_SAVE(r1)
|
|
|
5de29b |
+ cfi_offset (lr, FRAME_LR_SAVE)
|
|
|
5de29b |
mfcr r0
|
|
|
5de29b |
std r9,INT_PARMS+48(r1)
|
|
|
5de29b |
std r10,INT_PARMS+56(r1)
|
|
|
5de29b |
/* I'm almost certain we don't have to save cr... be safe. */
|
|
|
5de29b |
- std r0,FRAME_SIZE+8(r1)
|
|
|
5de29b |
+ std r0,FRAME_SIZE+FRAME_CR_SAVE(r1)
|
|
|
5de29b |
bl JUMPTARGET(_dl_fixup)
|
|
|
5de29b |
#ifndef SHARED
|
|
|
5de29b |
nop
|
|
|
5de29b |
#endif
|
|
|
5de29b |
/* Put the registers back. */
|
|
|
5de29b |
- ld r0,FRAME_SIZE+16(r1)
|
|
|
5de29b |
+ ld r0,FRAME_SIZE+FRAME_LR_SAVE(r1)
|
|
|
5de29b |
ld r10,INT_PARMS+56(r1)
|
|
|
5de29b |
ld r9,INT_PARMS+48(r1)
|
|
|
5de29b |
ld r8,INT_PARMS+40(r1)
|
|
|
5de29b |
ld r7,INT_PARMS+32(r1)
|
|
|
5de29b |
mtlr r0
|
|
|
5de29b |
- ld r0,FRAME_SIZE+8(r1)
|
|
|
5de29b |
+ ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1)
|
|
|
5de29b |
ld r6,INT_PARMS+24(r1)
|
|
|
5de29b |
ld r5,INT_PARMS+16(r1)
|
|
|
5de29b |
ld r4,INT_PARMS+8(r1)
|
|
|
5de29b |
@@ -76,7 +76,7 @@
|
|
|
5de29b |
ld r3,INT_PARMS+0(r1)
|
|
|
5de29b |
#if _CALL_ELF == 2
|
|
|
5de29b |
/* Restore the caller's TOC in case we jump to a local entry point. */
|
|
|
5de29b |
- ld r2,FRAME_SIZE+40(r1)
|
|
|
5de29b |
+ ld r2,FRAME_SIZE+FRAME_TOC_SAVE(r1)
|
|
|
5de29b |
#endif
|
|
|
5de29b |
/* Unwind the stack frame, and jump. */
|
|
|
5de29b |
addi r1,r1,FRAME_SIZE
|
|
|
5de29b |
@@ -86,6 +86,7 @@
|
|
|
5de29b |
#undef INT_PARMS
|
|
|
5de29b |
|
|
|
5de29b |
/* Stack layout:
|
|
|
5de29b |
+ (Note: some of these are not required for the ELFv2 ABI.)
|
|
|
5de29b |
+592 previous backchain
|
|
|
5de29b |
+584 spill_r31
|
|
|
5de29b |
+576 spill_r30
|
|
|
5de29b |
@@ -147,10 +148,11 @@
|
|
|
5de29b |
+64 parm3
|
|
|
5de29b |
+56 parm2
|
|
|
5de29b |
+48 parm1
|
|
|
5de29b |
- * Parameter save area, Allocated by the call, at least 8 double words
|
|
|
5de29b |
- +40 TOC save area
|
|
|
5de29b |
- +32 Reserved for linker
|
|
|
5de29b |
- +24 Reserved for compiler
|
|
|
5de29b |
+ * Parameter save area
|
|
|
5de29b |
+ * (v1 ABI: Allocated by the call, at least 8 double words)
|
|
|
5de29b |
+ +40 v1 ABI: TOC save area
|
|
|
5de29b |
+ +32 v1 ABI: Reserved for linker
|
|
|
5de29b |
+ +24 v1 ABI: Reserved for compiler / v2 ABI: TOC save area
|
|
|
5de29b |
+16 LR save area
|
|
|
5de29b |
+8 CR save area
|
|
|
5de29b |
r1+0 stack back chain
|
|
|
5de29b |
@@ -206,15 +208,15 @@
|
|
|
5de29b |
/* Store the LR in the LR Save area of the previous frame. */
|
|
|
5de29b |
/* XXX Do we have to do this? */
|
|
|
5de29b |
la r8,FRAME_SIZE(r1)
|
|
|
5de29b |
- std r5,FRAME_SIZE+16(r1)
|
|
|
5de29b |
- cfi_offset (lr, 16)
|
|
|
5de29b |
+ std r5,FRAME_SIZE+FRAME_LR_SAVE(r1)
|
|
|
5de29b |
+ cfi_offset (lr, FRAME_LR_SAVE)
|
|
|
5de29b |
std r5,CALLING_LR(r1)
|
|
|
5de29b |
mfcr r0
|
|
|
5de29b |
std r9,INT_PARMS+48(r1)
|
|
|
5de29b |
std r10,INT_PARMS+56(r1)
|
|
|
5de29b |
std r8,CALLING_SP(r1)
|
|
|
5de29b |
/* I'm almost certain we don't have to save cr... be safe. */
|
|
|
5de29b |
- std r0,FRAME_SIZE+8(r1)
|
|
|
5de29b |
+ std r0,FRAME_SIZE+FRAME_CR_SAVE(r1)
|
|
|
5de29b |
ld r12,.LC__dl_hwcap@toc(r2)
|
|
|
5de29b |
#ifdef SHARED
|
|
|
5de29b |
/* Load _rtld_local_ro._dl_hwcap. */
|
|
|
5de29b |
@@ -311,13 +313,13 @@
|
|
|
5de29b |
lvx v12,r11,r10
|
|
|
5de29b |
lvx v13,r11,r9
|
|
|
5de29b |
L(restoreFXR):
|
|
|
5de29b |
- ld r0,FRAME_SIZE+16(r1)
|
|
|
5de29b |
+ ld r0,FRAME_SIZE+FRAME_LR_SAVE(r1)
|
|
|
5de29b |
ld r10,INT_PARMS+56(r1)
|
|
|
5de29b |
ld r9,INT_PARMS+48(r1)
|
|
|
5de29b |
ld r8,INT_PARMS+40(r1)
|
|
|
5de29b |
ld r7,INT_PARMS+32(r1)
|
|
|
5de29b |
mtlr r0
|
|
|
5de29b |
- ld r0,FRAME_SIZE+8(r1)
|
|
|
5de29b |
+ ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1)
|
|
|
5de29b |
ld r6,INT_PARMS+24(r1)
|
|
|
5de29b |
ld r5,INT_PARMS+16(r1)
|
|
|
5de29b |
ld r4,INT_PARMS+8(r1)
|
|
|
5de29b |
@@ -327,7 +329,7 @@
|
|
|
5de29b |
ld r3,INT_PARMS+0(r1)
|
|
|
5de29b |
#if _CALL_ELF == 2
|
|
|
5de29b |
/* Restore the caller's TOC in case we jump to a local entry point. */
|
|
|
5de29b |
- ld r2,FRAME_SIZE+40(r1)
|
|
|
5de29b |
+ ld r2,FRAME_SIZE+FRAME_TOC_SAVE(r1)
|
|
|
5de29b |
#endif
|
|
|
5de29b |
/* Load the floating point registers. */
|
|
|
5de29b |
lfd fp1,FPR_PARMS+0(r1)
|
|
|
5de29b |
@@ -375,19 +377,19 @@
|
|
|
5de29b |
lvx v12,r11,r10
|
|
|
5de29b |
lvx v13,r11,r9
|
|
|
5de29b |
L(restoreFXR2):
|
|
|
5de29b |
- ld r0,FRAME_SIZE+16(r1)
|
|
|
5de29b |
+ ld r0,FRAME_SIZE+FRAME_LR_SAVE(r1)
|
|
|
5de29b |
ld r10,INT_PARMS+56(r1)
|
|
|
5de29b |
ld r9,INT_PARMS+48(r1)
|
|
|
5de29b |
ld r8,INT_PARMS+40(r1)
|
|
|
5de29b |
ld r7,INT_PARMS+32(r1)
|
|
|
5de29b |
mtlr r0
|
|
|
5de29b |
- ld r0,FRAME_SIZE+8(r1)
|
|
|
5de29b |
+ ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1)
|
|
|
5de29b |
ld r6,INT_PARMS+24(r1)
|
|
|
5de29b |
ld r5,INT_PARMS+16(r1)
|
|
|
5de29b |
ld r4,INT_PARMS+8(r1)
|
|
|
5de29b |
mtcrf 0xFF,r0
|
|
|
5de29b |
/* Prepare for calling the function returned by fixup. */
|
|
|
5de29b |
- std r2,40(r1)
|
|
|
5de29b |
+ std r2,FRAME_TOC_SAVE(r1)
|
|
|
5de29b |
PPC64_LOAD_FUNCPTR r3
|
|
|
5de29b |
ld r3,INT_PARMS+0(r1)
|
|
|
5de29b |
/* Load the floating point registers. */
|
|
|
5de29b |
@@ -406,7 +408,7 @@
|
|
|
5de29b |
lfd fp13,FPR_PARMS+96(r1)
|
|
|
5de29b |
/* Call the target function. */
|
|
|
5de29b |
bctrl
|
|
|
5de29b |
- ld r2,40(r1)
|
|
|
5de29b |
+ ld r2,FRAME_TOC_SAVE(r1)
|
|
|
5de29b |
lwz r12,VR_VRSAVE(r1)
|
|
|
5de29b |
/* But return here and store the return values. */
|
|
|
5de29b |
std r3,INT_RTN(r1)
|
|
|
5de29b |
@@ -441,7 +443,7 @@
|
|
|
5de29b |
beq L(pltexitreturn)
|
|
|
5de29b |
lvx v2,0,r10
|
|
|
5de29b |
L(pltexitreturn):
|
|
|
5de29b |
- ld r0,FRAME_SIZE+16(r1)
|
|
|
5de29b |
+ ld r0,FRAME_SIZE+FRAME_LR_SAVE(r1)
|
|
|
5de29b |
ld r31,584(r1)
|
|
|
5de29b |
ld r30,576(r1)
|
|
|
5de29b |
mtlr r0
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/ppc-mcount.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/ppc-mcount.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/ppc-mcount.S 2014-05-29 14:09:56.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/ppc-mcount.S 2014-05-29 14:10:00.000000000 -0500
|
|
|
5de29b |
@@ -24,16 +24,16 @@
|
|
|
5de29b |
ENTRY(_mcount)
|
|
|
5de29b |
mflr r4
|
|
|
5de29b |
ld r11, 0(r1)
|
|
|
5de29b |
- stdu r1,-112(r1)
|
|
|
5de29b |
- cfi_adjust_cfa_offset (112)
|
|
|
5de29b |
- std r4, 128(r1)
|
|
|
5de29b |
- cfi_offset (lr, 16)
|
|
|
5de29b |
- ld r3, 16(r11)
|
|
|
5de29b |
+ stdu r1,-FRAME_MIN_SIZE(r1)
|
|
|
5de29b |
+ cfi_adjust_cfa_offset (FRAME_MIN_SIZE)
|
|
|
5de29b |
+ std r4, FRAME_MIN_SIZE+FRAME_LR_SAVE(r1)
|
|
|
5de29b |
+ cfi_offset (lr, FRAME_LR_SAVE)
|
|
|
5de29b |
+ ld r3, FRAME_LR_SAVE(r11)
|
|
|
5de29b |
bl JUMPTARGET(__mcount_internal)
|
|
|
5de29b |
nop
|
|
|
5de29b |
- ld r0, 128(r1)
|
|
|
5de29b |
+ ld r0, FRAME_MIN_SIZE+FRAME_LR_SAVE(r1)
|
|
|
5de29b |
mtlr r0
|
|
|
5de29b |
- addi r1,r1,112
|
|
|
5de29b |
+ addi r1,r1,FRAME_MIN_SIZE
|
|
|
5de29b |
blr
|
|
|
5de29b |
END(_mcount)
|
|
|
5de29b |
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S 2014-05-29 14:09:56.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S 2014-05-29 14:10:00.000000000 -0500
|
|
|
5de29b |
@@ -56,7 +56,7 @@
|
|
|
5de29b |
bugz #269. __GI__setjmp is used in csu/libc-start.c when
|
|
|
5de29b |
HAVE_CLEANUP_JMP_BUF is defined. */
|
|
|
5de29b |
ENTRY (__GI__setjmp)
|
|
|
5de29b |
- std r2,40(r1) /* Save the callers TOC in the save area. */
|
|
|
5de29b |
+ std r2,FRAME_TOC_SAVE(r1) /* Save the callers TOC in the save area. */
|
|
|
5de29b |
CALL_MCOUNT 1
|
|
|
5de29b |
li r4,0 /* Set second argument to 0. */
|
|
|
5de29b |
b JUMPTARGET (GLUE(__sigsetjmp,_ent))
|
|
|
5de29b |
@@ -83,7 +83,7 @@
|
|
|
5de29b |
#endif
|
|
|
5de29b |
mflr r0
|
|
|
5de29b |
#if defined SHARED && !defined IS_IN_rtld
|
|
|
5de29b |
- ld r5,40(r1) /* Retrieve the callers TOC. */
|
|
|
5de29b |
+ ld r5,FRAME_TOC_SAVE(r1) /* Retrieve the callers TOC. */
|
|
|
5de29b |
std r5,(JB_GPR2*8)(3)
|
|
|
5de29b |
#else
|
|
|
5de29b |
std r2,(JB_GPR2*8)(3)
|
|
|
5de29b |
@@ -219,14 +219,14 @@
|
|
|
5de29b |
b JUMPTARGET (__sigjmp_save)
|
|
|
5de29b |
#else
|
|
|
5de29b |
mflr r0
|
|
|
5de29b |
- std r0,16(r1)
|
|
|
5de29b |
- stdu r1,-112(r1)
|
|
|
5de29b |
- cfi_adjust_cfa_offset(112)
|
|
|
5de29b |
- cfi_offset(lr,16)
|
|
|
5de29b |
+ std r0,FRAME_LR_SAVE(r1)
|
|
|
5de29b |
+ stdu r1,-FRAME_MIN_SIZE(r1)
|
|
|
5de29b |
+ cfi_adjust_cfa_offset(FRAME_MIN_SIZE)
|
|
|
5de29b |
+ cfi_offset(lr,FRAME_LR_SAVE)
|
|
|
5de29b |
bl JUMPTARGET (__sigjmp_save)
|
|
|
5de29b |
nop
|
|
|
5de29b |
- ld r0,112+16(r1)
|
|
|
5de29b |
- addi r1,r1,112
|
|
|
5de29b |
+ ld r0,FRAME_MIN_SIZE+FRAME_LR_SAVE(r1)
|
|
|
5de29b |
+ addi r1,r1,FRAME_MIN_SIZE
|
|
|
5de29b |
mtlr r0
|
|
|
5de29b |
blr
|
|
|
5de29b |
#endif
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h 2014-05-29 14:09:56.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h 2014-05-29 14:10:00.000000000 -0500
|
|
|
5de29b |
@@ -20,25 +20,67 @@
|
|
|
5de29b |
|
|
|
5de29b |
#ifdef __ASSEMBLER__
|
|
|
5de29b |
|
|
|
5de29b |
+/* Stack frame offsets. */
|
|
|
5de29b |
+#if _CALL_ELF != 2
|
|
|
5de29b |
+#define FRAME_MIN_SIZE 112
|
|
|
5de29b |
+#define FRAME_MIN_SIZE_PARM 112
|
|
|
5de29b |
+#define FRAME_BACKCHAIN 0
|
|
|
5de29b |
+#define FRAME_CR_SAVE 8
|
|
|
5de29b |
+#define FRAME_LR_SAVE 16
|
|
|
5de29b |
+#define FRAME_TOC_SAVE 40
|
|
|
5de29b |
+#define FRAME_PARM_SAVE 48
|
|
|
5de29b |
+#define FRAME_PARM1_SAVE 48
|
|
|
5de29b |
+#define FRAME_PARM2_SAVE 56
|
|
|
5de29b |
+#define FRAME_PARM3_SAVE 64
|
|
|
5de29b |
+#define FRAME_PARM4_SAVE 72
|
|
|
5de29b |
+#define FRAME_PARM5_SAVE 80
|
|
|
5de29b |
+#define FRAME_PARM6_SAVE 88
|
|
|
5de29b |
+#define FRAME_PARM7_SAVE 96
|
|
|
5de29b |
+#define FRAME_PARM8_SAVE 104
|
|
|
5de29b |
+#define FRAME_PARM9_SAVE 112
|
|
|
5de29b |
+#else
|
|
|
5de29b |
+#define FRAME_MIN_SIZE 32
|
|
|
5de29b |
+#define FRAME_MIN_SIZE_PARM 96
|
|
|
5de29b |
+#define FRAME_BACKCHAIN 0
|
|
|
5de29b |
+#define FRAME_CR_SAVE 8
|
|
|
5de29b |
+#define FRAME_LR_SAVE 16
|
|
|
5de29b |
+#define FRAME_TOC_SAVE 24
|
|
|
5de29b |
+#define FRAME_PARM_SAVE 32
|
|
|
5de29b |
+#define FRAME_PARM1_SAVE 32
|
|
|
5de29b |
+#define FRAME_PARM2_SAVE 40
|
|
|
5de29b |
+#define FRAME_PARM3_SAVE 48
|
|
|
5de29b |
+#define FRAME_PARM4_SAVE 56
|
|
|
5de29b |
+#define FRAME_PARM5_SAVE 64
|
|
|
5de29b |
+#define FRAME_PARM6_SAVE 72
|
|
|
5de29b |
+#define FRAME_PARM7_SAVE 80
|
|
|
5de29b |
+#define FRAME_PARM8_SAVE 88
|
|
|
5de29b |
+#define FRAME_PARM9_SAVE 96
|
|
|
5de29b |
+#endif
|
|
|
5de29b |
+
|
|
|
5de29b |
/* Support macros for CALL_MCOUNT. */
|
|
|
5de29b |
+#if _CALL_ELF == 2
|
|
|
5de29b |
+#define call_mcount_parm_offset (-64)
|
|
|
5de29b |
+#else
|
|
|
5de29b |
+#define call_mcount_parm_offset FRAME_PARM_SAVE
|
|
|
5de29b |
+#endif
|
|
|
5de29b |
.macro SAVE_ARG NARG
|
|
|
5de29b |
.if \NARG
|
|
|
5de29b |
SAVE_ARG \NARG-1
|
|
|
5de29b |
- std 2+\NARG,40+8*(\NARG)(1)
|
|
|
5de29b |
+ std 2+\NARG,call_mcount_parm_offset-8+8*(\NARG)(1)
|
|
|
5de29b |
.endif
|
|
|
5de29b |
.endm
|
|
|
5de29b |
|
|
|
5de29b |
.macro REST_ARG NARG
|
|
|
5de29b |
.if \NARG
|
|
|
5de29b |
REST_ARG \NARG-1
|
|
|
5de29b |
- ld 2+\NARG,112+40+8*(\NARG)(1)
|
|
|
5de29b |
+ ld 2+\NARG,FRAME_MIN_SIZE_PARM+call_mcount_parm_offset-8+8*(\NARG)(1)
|
|
|
5de29b |
.endif
|
|
|
5de29b |
.endm
|
|
|
5de29b |
|
|
|
5de29b |
.macro CFI_SAVE_ARG NARG
|
|
|
5de29b |
.if \NARG
|
|
|
5de29b |
CFI_SAVE_ARG \NARG-1
|
|
|
5de29b |
- cfi_offset(2+\NARG,40+8*(\NARG))
|
|
|
5de29b |
+ cfi_offset(2+\NARG,call_mcount_parm_offset-8+8*(\NARG))
|
|
|
5de29b |
.endif
|
|
|
5de29b |
.endm
|
|
|
5de29b |
|
|
|
5de29b |
@@ -55,20 +97,20 @@
|
|
|
5de29b |
#ifdef PROF
|
|
|
5de29b |
mflr r0
|
|
|
5de29b |
SAVE_ARG \NARG
|
|
|
5de29b |
- std r0,16(r1)
|
|
|
5de29b |
- stdu r1,-112(r1)
|
|
|
5de29b |
- cfi_adjust_cfa_offset(112)
|
|
|
5de29b |
- cfi_offset(lr,16)
|
|
|
5de29b |
+ std r0,FRAME_LR_SAVE(r1)
|
|
|
5de29b |
+ stdu r1,-FRAME_MIN_SIZE_PARM(r1)
|
|
|
5de29b |
+ cfi_adjust_cfa_offset(FRAME_MIN_SIZE_PARM)
|
|
|
5de29b |
+ cfi_offset(lr,FRAME_LR_SAVE)
|
|
|
5de29b |
CFI_SAVE_ARG \NARG
|
|
|
5de29b |
bl JUMPTARGET (_mcount)
|
|
|
5de29b |
#ifndef SHARED
|
|
|
5de29b |
nop
|
|
|
5de29b |
#endif
|
|
|
5de29b |
- ld r0,128(r1)
|
|
|
5de29b |
+ ld r0,FRAME_MIN_SIZE_PARM+FRAME_LR_SAVE(r1)
|
|
|
5de29b |
REST_ARG \NARG
|
|
|
5de29b |
mtlr r0
|
|
|
5de29b |
- addi r1,r1,112
|
|
|
5de29b |
- cfi_adjust_cfa_offset(-112)
|
|
|
5de29b |
+ addi r1,r1,FRAME_MIN_SIZE_PARM
|
|
|
5de29b |
+ cfi_adjust_cfa_offset(-FRAME_MIN_SIZE_PARM)
|
|
|
5de29b |
cfi_restore(lr)
|
|
|
5de29b |
CFI_REST_ARG \NARG
|
|
|
5de29b |
#endif
|
|
|
5de29b |
@@ -267,15 +309,15 @@
|
|
|
5de29b |
.else; \
|
|
|
5de29b |
.Local_syscall_error: \
|
|
|
5de29b |
mflr 0; \
|
|
|
5de29b |
- std 0,16(1); \
|
|
|
5de29b |
- stdu 1,-112(1); \
|
|
|
5de29b |
- cfi_adjust_cfa_offset(112); \
|
|
|
5de29b |
- cfi_offset(lr,16); \
|
|
|
5de29b |
+ std 0,FRAME_LR_SAVE(1); \
|
|
|
5de29b |
+ stdu 1,-FRAME_MIN_SIZE(1); \
|
|
|
5de29b |
+ cfi_adjust_cfa_offset(FRAME_MIN_SIZE); \
|
|
|
5de29b |
+ cfi_offset(lr,FRAME_LR_SAVE); \
|
|
|
5de29b |
bl JUMPTARGET(__syscall_error); \
|
|
|
5de29b |
nop; \
|
|
|
5de29b |
- ld 0,112+16(1); \
|
|
|
5de29b |
- addi 1,1,112; \
|
|
|
5de29b |
- cfi_adjust_cfa_offset(-112); \
|
|
|
5de29b |
+ ld 0,FRAME_MIN_SIZE+FRAME_LR_SAVE(1); \
|
|
|
5de29b |
+ addi 1,1,FRAME_MIN_SIZE; \
|
|
|
5de29b |
+ cfi_adjust_cfa_offset(-FRAME_MIN_SIZE); \
|
|
|
5de29b |
mtlr 0; \
|
|
|
5de29b |
cfi_restore(lr); \
|
|
|
5de29b |
blr; \
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/____longjmp_chk.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/____longjmp_chk.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/____longjmp_chk.S 2014-05-29 14:09:56.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/____longjmp_chk.S 2014-05-29 14:10:00.000000000 -0500
|
|
|
5de29b |
@@ -33,24 +33,24 @@
|
|
|
5de29b |
cmpld reg, r1; \
|
|
|
5de29b |
bge+ .Lok; \
|
|
|
5de29b |
mflr r0; \
|
|
|
5de29b |
- std r0,16(r1); \
|
|
|
5de29b |
+ std r0,FRAME_LR_SAVE(r1); \
|
|
|
5de29b |
mr r31,r3; \
|
|
|
5de29b |
mr r30,r4; \
|
|
|
5de29b |
- stdu r1,-144(r1); \
|
|
|
5de29b |
+ stdu r1,-FRAME_MIN_SIZE-32(r1); \
|
|
|
5de29b |
cfi_remember_state; \
|
|
|
5de29b |
- cfi_adjust_cfa_offset (144); \
|
|
|
5de29b |
- cfi_offset (lr, 16); \
|
|
|
5de29b |
+ cfi_adjust_cfa_offset (FRAME_MIN_SIZE+32); \
|
|
|
5de29b |
+ cfi_offset (lr, FRAME_LR_SAVE); \
|
|
|
5de29b |
li r3,0; \
|
|
|
5de29b |
- addi r4,r1,112; \
|
|
|
5de29b |
+ addi r4,r1,FRAME_MIN_SIZE; \
|
|
|
5de29b |
li r0,__NR_sigaltstack; \
|
|
|
5de29b |
sc; \
|
|
|
5de29b |
/* Without working sigaltstack we cannot perform the test. */ \
|
|
|
5de29b |
bso .Lok2; \
|
|
|
5de29b |
- lwz r0,112+8(r1); \
|
|
|
5de29b |
+ lwz r0,FRAME_MIN_SIZE+8(r1); \
|
|
|
5de29b |
andi. r4,r0,1; \
|
|
|
5de29b |
beq .Lfail; \
|
|
|
5de29b |
- ld r0,112+16(r1); \
|
|
|
5de29b |
- ld r4,112(r1); \
|
|
|
5de29b |
+ ld r0,FRAME_MIN_SIZE+16(r1); \
|
|
|
5de29b |
+ ld r4,FRAME_MIN_SIZE(r1); \
|
|
|
5de29b |
add r4,r4,r0; \
|
|
|
5de29b |
sub r3,r3,reg; \
|
|
|
5de29b |
cmpld r3,r0; \
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S 2014-05-29 14:09:56.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S 2014-05-29 14:10:00.000000000 -0500
|
|
|
5de29b |
@@ -31,9 +31,9 @@
|
|
|
5de29b |
CALL_MCOUNT 1
|
|
|
5de29b |
DISCARD_BOUNDS (r3) /* the bounds are meaningless, so toss 'em. */
|
|
|
5de29b |
|
|
|
5de29b |
- std r3,48(r1)
|
|
|
5de29b |
+ std r3,-8(r1)
|
|
|
5de29b |
DO_CALL(SYS_ify(brk))
|
|
|
5de29b |
- ld r6,48(r1)
|
|
|
5de29b |
+ ld r6,-8(r1)
|
|
|
5de29b |
ld r5,.LC__curbrk@toc(r2)
|
|
|
5de29b |
std r3,0(r5)
|
|
|
5de29b |
cmpld r6,r3
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S 2014-05-29 14:09:56.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S 2014-05-29 14:10:00.000000000 -0500
|
|
|
5de29b |
@@ -45,22 +45,22 @@
|
|
|
5de29b |
cror cr0*4+eq,cr1*4+eq,cr0*4+eq
|
|
|
5de29b |
beq- cr0,L(badargs)
|
|
|
5de29b |
|
|
|
5de29b |
- /* Save some regs in parm save area. */
|
|
|
5de29b |
+ /* Save some regs in the "red zone". */
|
|
|
5de29b |
#ifdef RESET_PID
|
|
|
5de29b |
- std r29,48(r1)
|
|
|
5de29b |
+ std r29,-24(r1)
|
|
|
5de29b |
#endif
|
|
|
5de29b |
- std r30,56(r1)
|
|
|
5de29b |
- std r31,64(r1)
|
|
|
5de29b |
+ std r30,-16(r1)
|
|
|
5de29b |
+ std r31,-8(r1)
|
|
|
5de29b |
#ifdef RESET_PID
|
|
|
5de29b |
- cfi_offset(r29,48)
|
|
|
5de29b |
+ cfi_offset(r29,-24)
|
|
|
5de29b |
#endif
|
|
|
5de29b |
- cfi_offset(r30,56)
|
|
|
5de29b |
- cfi_offset(r31,64)
|
|
|
5de29b |
+ cfi_offset(r30,-16)
|
|
|
5de29b |
+ cfi_offset(r31,-8)
|
|
|
5de29b |
|
|
|
5de29b |
/* Set up stack frame for child. */
|
|
|
5de29b |
clrrdi r4,r4,4
|
|
|
5de29b |
li r0,0
|
|
|
5de29b |
- stdu r0,-112(r4) /* min stack frame is 112 bytes per ABI */
|
|
|
5de29b |
+ stdu r0,-FRAME_MIN_SIZE_PARM(r4)
|
|
|
5de29b |
|
|
|
5de29b |
/* Save fn, args, stack across syscall. */
|
|
|
5de29b |
mr r30,r3 /* Function in r30. */
|
|
|
5de29b |
@@ -102,12 +102,12 @@
|
|
|
5de29b |
L(oldpid):
|
|
|
5de29b |
#endif
|
|
|
5de29b |
|
|
|
5de29b |
- std r2,40(r1)
|
|
|
5de29b |
+ std r2,FRAME_TOC_SAVE(r1)
|
|
|
5de29b |
/* Call procedure. */
|
|
|
5de29b |
PPC64_LOAD_FUNCPTR r30
|
|
|
5de29b |
mr r3,r31
|
|
|
5de29b |
bctrl
|
|
|
5de29b |
- ld r2,40(r1)
|
|
|
5de29b |
+ ld r2,FRAME_TOC_SAVE(r1)
|
|
|
5de29b |
/* Call _exit with result from procedure. */
|
|
|
5de29b |
#ifdef SHARED
|
|
|
5de29b |
b JUMPTARGET(__GI__exit)
|
|
|
5de29b |
@@ -126,15 +126,15 @@
|
|
|
5de29b |
L(parent):
|
|
|
5de29b |
/* Parent. Restore registers & return. */
|
|
|
5de29b |
#ifdef RESET_PID
|
|
|
5de29b |
- cfi_offset(r29,48)
|
|
|
5de29b |
+ cfi_offset(r29,-24)
|
|
|
5de29b |
#endif
|
|
|
5de29b |
- cfi_offset(r30,56)
|
|
|
5de29b |
- cfi_offset(r31,64)
|
|
|
5de29b |
+ cfi_offset(r30,-16)
|
|
|
5de29b |
+ cfi_offset(r31,-8)
|
|
|
5de29b |
#ifdef RESET_PID
|
|
|
5de29b |
- ld r29,48(r1)
|
|
|
5de29b |
+ ld r29,-24(r1)
|
|
|
5de29b |
#endif
|
|
|
5de29b |
- ld r30,56(r1)
|
|
|
5de29b |
- ld r31,64(r1)
|
|
|
5de29b |
+ ld r30,-16(r1)
|
|
|
5de29b |
+ ld r31,-8(r1)
|
|
|
5de29b |
#ifdef RESET_PID
|
|
|
5de29b |
cfi_restore(r29)
|
|
|
5de29b |
#endif
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S 2014-05-29 14:09:56.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S 2014-05-29 14:10:00.000000000 -0500
|
|
|
5de29b |
@@ -46,8 +46,13 @@
|
|
|
5de29b |
# endif
|
|
|
5de29b |
#endif
|
|
|
5de29b |
|
|
|
5de29b |
-#define FRAMESIZE 128
|
|
|
5de29b |
-#define stackblock FRAMESIZE+48 /* offset to parm save area. */
|
|
|
5de29b |
+#if _CALL_ELF == 2
|
|
|
5de29b |
+#define FRAMESIZE (FRAME_MIN_SIZE+16+64)
|
|
|
5de29b |
+#define stackblock (FRAME_MIN_SIZE+16)
|
|
|
5de29b |
+#else
|
|
|
5de29b |
+#define FRAMESIZE (FRAME_MIN_SIZE+16)
|
|
|
5de29b |
+#define stackblock (FRAMESIZE+FRAME_PARM_SAVE) /* offset to parm save area. */
|
|
|
5de29b |
+#endif
|
|
|
5de29b |
|
|
|
5de29b |
.text
|
|
|
5de29b |
ENTRY(__socket)
|
|
|
5de29b |
@@ -98,22 +103,22 @@
|
|
|
5de29b |
.Lsocket_cancel:
|
|
|
5de29b |
cfi_adjust_cfa_offset(FRAMESIZE)
|
|
|
5de29b |
mflr r9
|
|
|
5de29b |
- std r9,FRAMESIZE+16(r1)
|
|
|
5de29b |
- cfi_offset (lr, 16)
|
|
|
5de29b |
+ std r9,FRAMESIZE+FRAME_LR_SAVE(r1)
|
|
|
5de29b |
+ cfi_offset (lr, FRAME_LR_SAVE)
|
|
|
5de29b |
CENABLE
|
|
|
5de29b |
- std r3,120(r1)
|
|
|
5de29b |
+ std r3,FRAME_MIN_SIZE+8(r1)
|
|
|
5de29b |
li r3,P(SOCKOP_,socket)
|
|
|
5de29b |
addi r4,r1,stackblock
|
|
|
5de29b |
DO_CALL(SYS_ify(socketcall))
|
|
|
5de29b |
mfcr r0
|
|
|
5de29b |
- std r3,112(r1)
|
|
|
5de29b |
- std r0,FRAMESIZE+8(r1)
|
|
|
5de29b |
- cfi_offset (cr, 8)
|
|
|
5de29b |
- ld r3,120(r1)
|
|
|
5de29b |
+ std r3,FRAME_MIN_SIZE(r1)
|
|
|
5de29b |
+ std r0,FRAMESIZE+FRAME_CR_SAVE(r1)
|
|
|
5de29b |
+ cfi_offset (cr, FRAME_CR_SAVE)
|
|
|
5de29b |
+ ld r3,FRAME_MIN_SIZE+8(r1)
|
|
|
5de29b |
CDISABLE
|
|
|
5de29b |
- ld r4,FRAMESIZE+16(r1)
|
|
|
5de29b |
- ld r0,FRAMESIZE+8(r1)
|
|
|
5de29b |
- ld r3,112(r1)
|
|
|
5de29b |
+ ld r4,FRAMESIZE+FRAME_LR_SAVE(r1)
|
|
|
5de29b |
+ ld r0,FRAMESIZE+FRAME_CR_SAVE(r1)
|
|
|
5de29b |
+ ld r3,FRAME_MIN_SIZE(r1)
|
|
|
5de29b |
mtlr r4
|
|
|
5de29b |
mtcr r0
|
|
|
5de29b |
addi r1,r1,FRAMESIZE
|
|
|
12745e |
diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym
|
|
|
12745e |
--- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym 2014-05-29 14:09:56.000000000 -0500
|
|
|
12745e |
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym 2014-05-29 14:10:00.000000000 -0500
|
|
|
5de29b |
@@ -8,27 +8,6 @@
|
|
|
5de29b |
SIG_SETMASK
|
|
|
5de29b |
|
|
|
5de29b |
|
|
|
5de29b |
--- Offsets of the fields in the powerpc64 ABI stack frame.
|
|
|
5de29b |
--- XXX Do these correspond to some struct?
|
|
|
5de29b |
-
|
|
|
5de29b |
-FRAME_BACKCHAIN 0
|
|
|
5de29b |
-FRAME_CR_SAVE 8
|
|
|
5de29b |
-FRAME_LR_SAVE 16
|
|
|
5de29b |
-FRAME_COMPILER_DW 24
|
|
|
5de29b |
-FRAME_LINKER_DW 32
|
|
|
5de29b |
-FRAME_TOC_SAVE 40
|
|
|
5de29b |
-FRAME_PARM_SAVE 48
|
|
|
5de29b |
-FRAME_PARM1_SAVE 48
|
|
|
5de29b |
-FRAME_PARM2_SAVE 56
|
|
|
5de29b |
-FRAME_PARM3_SAVE 64
|
|
|
5de29b |
-FRAME_PARM4_SAVE 72
|
|
|
5de29b |
-FRAME_PARM5_SAVE 80
|
|
|
5de29b |
-FRAME_PARM6_SAVE 88
|
|
|
5de29b |
-FRAME_PARM7_SAVE 96
|
|
|
5de29b |
-FRAME_PARM8_SAVE 104
|
|
|
5de29b |
-FRAME_PARM9_SAVE 112
|
|
|
5de29b |
-
|
|
|
5de29b |
-
|
|
|
5de29b |
-- Offsets of the fields in the ucontext_t structure.
|
|
|
5de29b |
#define ucontext(member) offsetof (ucontext_t, member)
|
|
|
5de29b |
#define mcontext(member) ucontext (uc_mcontext.member)
|