diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-12-28 10:27:06 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-12-28 10:28:22 +0100 |
commit | ae49f218daca0b7cab27764da4081e6509bc7345 (patch) | |
tree | fef5fa1b87b9bc540c84690c3128c252651f6f34 /hurd/hurdsock.c | |
parent | 2ce0481d26066b7d4e2c950da555a7ca20e313fb (diff) | |
download | glibc-ae49f218daca0b7cab27764da4081e6509bc7345.tar glibc-ae49f218daca0b7cab27764da4081e6509bc7345.tar.gz glibc-ae49f218daca0b7cab27764da4081e6509bc7345.tar.bz2 glibc-ae49f218daca0b7cab27764da4081e6509bc7345.zip |
hurd: Fix static-PIE startup
hurd initialization stages use RUN_HOOK to run various initialization
functions. That is however using absolute addresses which need to be
relocated, which is done later by csu. We can however easily make the
linker compute relative addresses which thus don't need a relocation.
The new SET_RELHOOK and RUN_RELHOOK macros implement this.
Diffstat (limited to 'hurd/hurdsock.c')
-rw-r--r-- | hurd/hurdsock.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/hurd/hurdsock.c b/hurd/hurdsock.c index 04e86b4324..116326b2f2 100644 --- a/hurd/hurdsock.c +++ b/hurd/hurdsock.c @@ -25,6 +25,7 @@ #include <_itoa.h> #include <lock-intern.h> /* For `struct mutex'. */ #include "hurdmalloc.h" /* XXX */ +#include "set-hooks.h" static struct mutex lock; @@ -109,7 +110,7 @@ retry: return server; } -static void +static void attribute_used_retain init (void) { int i; @@ -118,7 +119,5 @@ init (void) for (i = 0; i < max_domain; ++i) servers[i] = MACH_PORT_NULL; - - (void) &init; /* Avoid "defined but not used" warning. */ } -text_set_element (_hurd_preinit_hook, init); +SET_RELHOOK (_hurd_preinit_hook, init); |