From ae49f218daca0b7cab27764da4081e6509bc7345 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 28 Dec 2021 10:27:06 +0100 Subject: 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. --- hurd/hurdrlimit.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'hurd/hurdrlimit.c') diff --git a/hurd/hurdrlimit.c b/hurd/hurdrlimit.c index 17535c2..4d16bd4 100644 --- a/hurd/hurdrlimit.c +++ b/hurd/hurdrlimit.c @@ -19,6 +19,7 @@ #include #include #include +#include "set-hooks.h" /* This must be given an initializer, or the a.out linking rules will not include the entire file when this symbol is referenced. */ @@ -29,7 +30,7 @@ struct rlimit _hurd_rlimits[RLIM_NLIMITS] = { { 0, }, }; mutex_init is still required below just in case of unexec. */ struct mutex _hurd_rlimit_lock = { SPIN_LOCK_INITIALIZER, }; -static void +static void attribute_used_retain init_rlimit (void) { int i; @@ -52,7 +53,5 @@ init_rlimit (void) } #undef I } - - (void) &init_rlimit; } -text_set_element (_hurd_preinit_hook, init_rlimit); +SET_RELHOOK (_hurd_preinit_hook, init_rlimit); -- cgit v1.1