diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-05-28 00:29:14 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-05-28 00:30:26 +0200 |
commit | 9ffdcf5b79acacffc35506812ca8d99ea1dde618 (patch) | |
tree | 2d4bb7f6c1c9cb8b578dfbc6ff64a13ddc1722fa /sysdeps | |
parent | 0660ab264fdfd49555430790267b539d1177192f (diff) | |
download | glibc-9ffdcf5b79acacffc35506812ca8d99ea1dde618.tar.gz glibc-9ffdcf5b79acacffc35506812ca8d99ea1dde618.tar.xz glibc-9ffdcf5b79acacffc35506812ca8d99ea1dde618.zip |
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')
-rw-r--r-- | sysdeps/mach/hurd/_Fork.c | 12 |
1 files 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)) |