public inbox for
help / color / mirror / Atom feed
From: Adhemerval Zanella <>
Subject: [glibc] sparc: Remove unwind information from signal return stubs [BZ #31244]
Date: Thu, 18 Jan 2024 11:48:00 +0000 (GMT)	[thread overview]
Message-ID: <> (raw);h=7bd06985c0a143cdcba2762bfe020e53514a53de

commit 7bd06985c0a143cdcba2762bfe020e53514a53de
Author: Daniel Cederman <>
Date:   Tue Jan 16 09:31:41 2024 +0100

    sparc: Remove unwind information from signal return stubs [BZ #31244]
    The functions were previously written in C, but were not compiled
    with unwind information. The ENTRY/END macros includes .cfi_startproc
    and .cfi_endproc which adds unwind information. This caused the
    tests cleanup-8 and cleanup-10 in the GCC testsuite to fail.
    This patch adds a version of the ENTRY/END macros without the
    CFI instructions that can be used instead.
    sigaction registers a restorer address that is located two instructions
    before the stub function. This patch adds a two instruction padding to
    avoid that the unwinder accesses the unwind information from the function
    that the linker has placed right before it in memory. This fixes an issue
    with pthread_cancel that caused tst-mutex8-static (and other tests) to fail.
    Signed-off-by: Daniel Cederman <>
    Reviewed-by: Adhemerval Zanella  <>

 sysdeps/sparc/sysdep.h                                 |  9 +++++++++
 sysdeps/unix/sysv/linux/sparc/sparc32/sigreturn_stub.S | 11 +++++++----
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/sysdeps/sparc/sysdep.h b/sysdeps/sparc/sysdep.h
index c00fe79fec..44a6952bff 100644
--- a/sysdeps/sparc/sysdep.h
+++ b/sysdeps/sparc/sysdep.h
@@ -76,6 +76,15 @@ C_LABEL(name)				\
 	cfi_endproc;			\
 	.size name, . - name
+#define ENTRY_NOCFI(name)			\
+	.align	4;			\
+	.global	C_SYMBOL_NAME(name);	\
+	.type	name, @function;	\
+#define END_NOCFI(name)			\
+	.size name, . - name
 #undef LOC
 #define LOC(name)  .L##name
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sigreturn_stub.S b/sysdeps/unix/sysv/linux/sparc/sparc32/sigreturn_stub.S
index 832223f8ce..21d36c50df 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/sigreturn_stub.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sigreturn_stub.S
@@ -23,12 +23,15 @@
    [1]  */
-ENTRY (__rt_sigreturn_stub)
+	nop
+	nop
+ENTRY_NOCFI (__rt_sigreturn_stub)
 	mov	__NR_rt_sigreturn, %g1
 	ta	0x10
-END (__rt_sigreturn_stub)
+END_NOCFI (__rt_sigreturn_stub)
-ENTRY (__sigreturn_stub)
+ENTRY_NOCFI (__sigreturn_stub)
 	mov	__NR_sigreturn, %g1
 	ta	0x10
-END (__sigreturn_stub)
+END_NOCFI (__sigreturn_stub)

                 reply	other threads:[~2024-01-18 11:48 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:

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

  git send-email \ \ \ \

* 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).