aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/mach
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2023-05-28 00:29:14 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-05-28 00:30:26 +0200
commit9ffdcf5b79acacffc35506812ca8d99ea1dde618 (patch)
tree2d4bb7f6c1c9cb8b578dfbc6ff64a13ddc1722fa /sysdeps/mach
parent0660ab264fdfd49555430790267b539d1177192f (diff)
downloadglibc-9ffdcf5b79acacffc35506812ca8d99ea1dde618.zip
glibc-9ffdcf5b79acacffc35506812ca8d99ea1dde618.tar.gz
glibc-9ffdcf5b79acacffc35506812ca8d99ea1dde618.tar.bz2
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.
Diffstat (limited to 'sysdeps/mach')
-rw-r--r--sysdeps/mach/hurd/_Fork.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sysdeps/mach/hurd/_Fork.c b/sysdeps/mach/hurd/_Fork.c
index 77cd291..9981699 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))