1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

hurd: keep only required PLTs in ld.so

We need NO_RTLD_HIDDEN because of the need for PLT calls in ld.so.
See Roland's comment in
https://sourceware.org/bugzilla/show_bug.cgi?id=15605
"in the Hurd it's crucial that calls like __mmap be the libc ones
instead of the rtld-local ones after the bootstrap phase, when the
dynamic linker is being used for dlopen and the like."

We used to just avoid all hidden use in the rtld ; this commit switches to
keeping only those that should use PLT calls, i.e. essentially those defined in
sysdeps/mach/hurd/dl-sysdep.c:

__assert_fail
__assert_perror_fail
__*stat64
_exit

This fixes a few startup issues, notably the call to __tunable_get_val that is
made before PLTs are set up.
This commit is contained in:
Samuel Thibault
2020-11-10 23:35:19 +00:00
parent a40b18b233
commit 3d3316b1de
17 changed files with 20 additions and 34 deletions

View File

@ -292,7 +292,9 @@ Inconsistency detected by ld.so: %s: %u: %s%sAssertion `%s' failed!\n",
assertion);
}
# ifndef NO_RTLD_HIDDEN
rtld_hidden_weak (__assert_fail)
# endif
void weak_function
__assert_perror_fail (int errnum,
@ -306,7 +308,9 @@ Inconsistency detected by ld.so: %s: %u: %s%sUnexpected error: %s.\n",
__strerror_r (errnum, errbuf, sizeof errbuf));
}
# ifndef NO_RTLD_HIDDEN
rtld_hidden_weak (__assert_perror_fail)
# endif
#endif
#undef _itoa