public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Ulrich Drepper <drepper@redhat.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: [PATCH] Fix s390{,x} _JMPBUF_CFA_UNWINDS_ADJ
Date: Wed, 06 Oct 2004 09:00:00 -0000	[thread overview]
Message-ID: <20041006085908.GI30497@sunsite.ms.mff.cuni.cz> (raw)

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

                 reply	other threads:[~2004-10-06  9:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041006085908.GI30497@sunsite.ms.mff.cuni.cz \
    --to=jakub@redhat.com \
    --cc=drepper@redhat.com \
    --cc=libc-hacker@sources.redhat.com \
    --cc=schwidefsky@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).