public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] hurd: Fix setting up signal thread stack alignment
@ 2023-05-27 22:32 Samuel Thibault
  0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2023-05-27 22:32 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9ffdcf5b79acacffc35506812ca8d99ea1dde618

commit 9ffdcf5b79acacffc35506812ca8d99ea1dde618
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sun May 28 00:29:14 2023 +0200

    hurd: Fix setting up signal thread stack alignment
    
    x86_64 needs special alignment when calling functions, so we have to use
    MACHINE_THREAD_STATE_SETUP_CALL for the signal thread when forking.

Diff:
---
 sysdeps/mach/hurd/_Fork.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/sysdeps/mach/hurd/_Fork.c b/sysdeps/mach/hurd/_Fork.c
index 77cd29171e..9981699a5a 100644
--- a/sysdeps/mach/hurd/_Fork.c
+++ b/sysdeps/mach/hurd/_Fork.c
@@ -481,13 +481,11 @@ retry:
 				    MACHINE_THREAD_STATE_FLAVOR,
 				    (natural_t *) &state, &statecount))
 	LOSE;
-#ifdef STACK_GROWTH_UP
-      state.SP = __hurd_sigthread_stack_base;
-#else
-      state.SP = __hurd_sigthread_stack_end;
-#endif
-      MACHINE_THREAD_STATE_SET_PC (&state,
-				   (unsigned long int) _hurd_msgport_receive);
+
+      MACHINE_THREAD_STATE_SETUP_CALL(&state,
+	  __hurd_sigthread_stack_base,
+	  __hurd_sigthread_stack_end - __hurd_sigthread_stack_base,
+	  (uintptr_t) _hurd_msgport_receive);
 
       /* Do special signal thread setup for TLS if needed.  */
       if (err = _hurd_tls_fork (sigthread, _hurd_msgport_thread, &state))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-27 22:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-27 22:32 [glibc] hurd: Fix setting up signal thread stack alignment Samuel Thibault

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