This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] fix setjmp on powerpc64


Hi,

sysdeps/powerpc/bits/setjmp.h needs to include bits/wordsize.h to get
the __WORDSIZE definition. Without that, the jmp_buf array size would be
58 instead of 40 and ./sysdeps/generic/sigjmp.c would silently corrupt
memory. The userland (readline in this case) includes wctype.h and that
includes wordsize.h.

There is also a typo in sysdeps/powerpc/powerpc64/setjmp.S
Register 18 was stored in the wrong place, offset is 4, not 8.


2002-12-14  Olaf Hering <olh@suse.de>
        
        * sysdeps/powerpc/bits/setjmp.h: include <bits/wordsize.h>
        * sysdeps/powerpc/powerpc64/setjmp.S: fix typo


Index: sysdeps/powerpc/bits/setjmp.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/powerpc/bits/setjmp.h,v
retrieving revision 1.8
diff -u -r1.8 setjmp.h
--- sysdeps/powerpc/bits/setjmp.h       20 Sep 2002 20:01:38 -0000      1.8
+++ sysdeps/powerpc/bits/setjmp.h       15 Dec 2002 10:33:48 -0000
@@ -27,6 +27,8 @@
    assembler easier. Naturally, user code should not depend on
    either representation. */

+#include <bits/wordsize.h>
+
 #if defined __USE_MISC || defined _ASM
 # define JB_GPR1   0  /* Also known as the stack pointer */
 # define JB_GPR2   1
Index: sysdeps/powerpc/powerpc64/setjmp.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/powerpc/powerpc64/setjmp.S,v
retrieving revision 1.1
diff -u -r1.1 setjmp.S
--- sysdeps/powerpc/powerpc64/setjmp.S  17 Sep 2002 23:50:02 -0000      1.1
+++ sysdeps/powerpc/powerpc64/setjmp.S  15 Dec 2002 10:33:48 -0000
@@ -42,7 +42,7 @@
        std  r0,(JB_CR*8)(3)
        std  r17,((JB_GPRS+3)*8)(3)
        stfd fp17,((JB_FPRS+3)*8)(3)
-       std  r18,((JB_GPRS+8)*8)(3)
+       std  r18,((JB_GPRS+4)*8)(3)
        stfd fp18,((JB_FPRS+4)*8)(3)
        std  r19,((JB_GPRS+5)*8)(3)
        stfd fp19,((JB_FPRS+5)*8)(3)



-- 
A: No.
Q: Should I include quotations after my reply?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]