hurd: Remove __hurd_local_reply_port
authorSergey Bugaev <bugaevc@gmail.com>
Thu, 13 Apr 2023 11:58:12 +0000 (14:58 +0300)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Fri, 14 Apr 2023 10:31:22 +0000 (10:31 +0000)
commitba00d787f3469b02032766b074d4df9071fa7e24
tree2686e3886f3ade9e279c7e3cdc66192b79d4576e
parent05fe3ecffff485032e904f0a3ea709e24d9188eb
hurd: Remove __hurd_local_reply_port

Now that the signal code no longer accesses it, the only real user of it
was mig-reply.c, so move the logic for managing the port there.

If we're in SHARED and outside of rtld, we know that __LIBC_NO_TLS ()
always evaluates to 0, and a TLS reply port will always be used, not
__hurd_reply_port0. Still, the compiler does not see that
__hurd_reply_port0 is never used due to its address being taken. To deal
with this, explicitly compile out __hurd_reply_port0 when we know we
won't use it.

Also, instead of accessing the port via THREAD_SELF->reply_port, this
uses THREAD_GETMEM and THREAD_SETMEM directly, avoiding possible
miscompilations.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
hurd/hurd/threadvar.h
sysdeps/mach/hurd/dl-sysdep.c
sysdeps/mach/hurd/mig-reply.c
sysdeps/mach/sysdep.h