* [PATCH] Fix s390{,x} _JMPBUF_CFA_UNWINDS_ADJ
@ 2004-10-06 9:00 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2004-10-06 9:00 UTC (permalink / raw)
To: Ulrich Drepper, Martin Schwidefsky; +Cc: Glibc hackers
Hi!
_Unwind_GetCFA () on s390{,x} returns address 96 (resp. 160) above
actual %r15 value, so with the recent stack space saving changes
on s390{,x} _JMPBUF_CFA_UNWINDS_ADJ misbehaves.
With this patch make check passes fully on s390 again.
2004-10-06 Jakub Jelinek <jakub@redhat.com>
* sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
(JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from
CFA.
--- libc/nptl/sysdeps/s390/jmpbuf-unwind.h 2004-09-02 18:46:00.000000000 -0400
+++ libc/nptl/sysdeps/s390/jmpbuf-unwind.h 2004-10-06 03:43:32.000000000 -0400
@@ -20,13 +20,18 @@
#include <setjmp.h>
#include <stdint.h>
#include <unwind.h>
+#include <bits/wordsize.h>
+/* On s390{,x}, CFA is always 96 (resp. 160) bytes above actual
+ %r15. */
#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
+ _JMPBUF_UNWINDS_ADJ (_jmpbuf, \
+ (void *) (_Unwind_GetCFA (_context) \
+ - 32 - 2 * __WORDSIZE), _adj)
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) \
+#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
+ ((uintptr_t) (_address) - (_adj) \
< (uintptr_t) (_jmpbuf)->__gregs[__JB_GPR15] - (_adj))
-/* We use the normal lobngjmp for unwinding. */
+/* We use the normal longjmp for unwinding. */
#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
Jakub
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-10-06 9:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-06 9:00 [PATCH] Fix s390{,x} _JMPBUF_CFA_UNWINDS_ADJ Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).