From 3d3316b1dee885153d44210b2e95dba68d00613a Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 10 Nov 2020 23:35:19 +0000 Subject: 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. --- sysdeps/mach/hurd/dl-sysdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sysdeps/mach/hurd/dl-sysdep.c') diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c index 5c0bb3124d..6b32d41c76 100644 --- a/sysdeps/mach/hurd/dl-sysdep.c +++ b/sysdeps/mach/hurd/dl-sysdep.c @@ -641,7 +641,8 @@ __sbrk (intptr_t increment) return (void *) addr; } -check_no_hidden(__strtoul_internal); +/* This is only used by hurdlookup for the /dev/fd/nnn magic. + * We avoid pulling the whole libc implementation, and we can keep this hidden. */ unsigned long int weak_function __strtoul_internal (const char *nptr, char **endptr, int base, int group) { @@ -698,7 +699,6 @@ abort (void) /* We need this alias to satisfy references from libc_pic.a objects that were affected by the libc_hidden_proto declaration for abort. */ strong_alias (abort, __GI_abort) -strong_alias (abort, __GI___chk_fail) strong_alias (abort, __GI___fortify_fail) strong_alias (abort, __GI___assert_fail) strong_alias (abort, __GI___assert_perror_fail) -- cgit v1.2.3