git-NO_HIDDEN
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Fri, 26 Jan 2018 22:35:29 +0000 (22:35 +0000)
committerAurelien Jarno <aurel32@debian.org>
Fri, 26 Jan 2018 22:35:29 +0000 (22:35 +0000)
commit 3d1870fa3301c5cd00d5fdab0014c4e22b71fef2
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Tue Oct 3 01:26:58 2017 +0200

    Introduce NO_RTLD_HIDDEN, make hurd use it instead of NO_HIDDEN

    On the Hurd, the rtld needs to see its own dumb versions of a few functions
    (defined in sysdeps/mach/hurd/dl-sysdep.c) overridden by libc's versions once
    loaded. rtld should thus not have hidden attribute for these.  To achieve this,
    the Hurd port used to just define NO_HIDDEN, which disables it completely. For
    now, this changes that to disabling it for all rtld functions, for simplicity.

    See Roland's comment on https://sourceware.org/bugzilla/show_bug.cgi?id=15605#c5

    The ld.so numbers remain at

      8 .rel.plt      000000c8  00000c24  00000c24  00000c24  2**2
                      CONTENTS, ALLOC, LOAD, READONLY, DATA
      9 .plt          000001a0  00000cf0  00000cf0  00000cf0  2**4
                      CONTENTS, ALLOC, LOAD, READONLY, CODE
     10 .plt.got      00000010  00000e90  00000e90  00000e90  2**3
                      CONTENTS, ALLOC, LOAD, READONLY, CODE
     18 .got.plt      00000070  0002d000  0002d000  0002c000  2**2
                      CONTENTS, ALLOC, LOAD, DATA

    which is about 3 times as much as on Linux.

    The libc.so numbers get divided by 3 (the remainings are mostly RPC stub calls)

            * include/libc-symbols.h [NO_RTLD_HIDDEN] (rtld_hidden_proto,
            rtld_hidden_tls_proto, rtld_hidden_def, rtld_hidden_weak,
            rtld_hidden_rtld_hidden_ver, data_def, rtld_hidden_data_weak,
            rtld_hidden_data_ver): Define to empty.
            * include/assert.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__assert_fail,
            __assert_perror_fail): Likewise.
            * include/dirent.h [IS_IN(rtld) && NO_RTLD_HIDDEN]
            (__rewinddir): Likewise.
            * include/libc-internal.h [IS_IN(rtld) && NO_RTLD_HIDDEN]
            (__profile_frequency): Likewise.
            * include/setjmp.h (__sigsetjmp): Likewise.
            * include/signal.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__sigaction,
            __libc_sigaction): Likewise.
            * include/stdlib.h [NO_RTLD_HIDDEN] (unsetenv, __strtoul_internal): Do
            not set hidden attribute.
            * include/string.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__stpcpy, __strdup,
            __strerror_t, __strsep_g, memchr, memcmp, memcpy, memmove, memset,
            rawmemchr, stpcpy, strchr, strcmp, strlen, strnlen, strsep): Likewise.
            * include/sys/stat.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__fxstat,
            __fxstat64, __lxstat, __lxstat64, __xstat, __xstat64,
            __fxstatat64): Likewise.
            * include/sys/utsname.h [IS_IN(rtld) && NO_RTLD_HIDDEN]
            (__uname): Likewise.
            * include/sysdeps/generic/_itoa.h [IS_IN(rtld) && NO_RTLD_HIDDEN]
            (_itoa_upper_digits, _itoa_lower_digits): Likewise.
            * sysdeps/mach/hurd/configure.ac (NO_HIDDEN): Do not set.
            (NO_RTLD_HIDDEN): Set.
            * sysdeps/mach/hurd/configure: Refresh.
            * config.h.in: Refresh.

Gbp-Pq: Topic hurd-i386
Gbp-Pq: Name git-NO_HIDDEN.diff

14 files changed:
config.h.in
include/assert.h
include/dirent.h
include/libc-internal.h
include/libc-symbols.h
include/setjmp.h
include/signal.h
include/stdlib.h
include/string.h
include/sys/stat.h
include/sys/utsname.h
sysdeps/generic/_itoa.h
sysdeps/mach/hurd/configure
sysdeps/mach/hurd/configure.ac

index 22418576a014b19661edff6c6ee1117dd3e3d34b..95498bed017356c3a92555c2e3a452037746a662 100644 (file)
    include/libc-symbols.h that avoid PLT slots in the shared objects.  */
 #undef NO_HIDDEN
 
+/* Define this to disable in rtld the 'hidden_proto' et al macros in
+   include/libc-symbols.h that avoid PLT slots in the shared objects.  */
+#undef NO_RTLD_HIDDEN
+
 /* Define this to disable lazy relocations in DSOs.  */
 #undef BIND_NOW
 
index c4526679562294a32b51f5ddfd18ade1c0596b1a..92cd246901736fd8550199a6d7478abfedcaabe2 100644 (file)
@@ -20,7 +20,7 @@ extern void __assert_fail_base (const char *fmt, const char *assertion,
                                const char *function)
      __THROW  __attribute__ ((__noreturn__));
 
-# if IS_IN (libc) || IS_IN (rtld)
+# if IS_IN (libc) || (IS_IN (rtld) && !defined NO_RTLD_HIDDEN)
 hidden_proto (__assert_fail)
 hidden_proto (__assert_perror_fail)
 # endif
index d7c97f9317ebffff2d305720aa953c5d8d330acd..ef85395df8722ef6294834e3aa12c9f8a0ce2f8c 100644 (file)
@@ -78,7 +78,7 @@ extern __typeof (scandirat) __scandirat;
 libc_hidden_proto (__scandirat)
 libc_hidden_proto (scandirat64)
 
-#  if IS_IN (rtld)
+#  if IS_IN (rtld) && !defined NO_RTLD_HIDDEN
 extern __typeof (__closedir) __closedir attribute_hidden;
 extern __typeof (__fdopendir) __fdopendir attribute_hidden;
 extern __typeof (__readdir) __readdir attribute_hidden;
index cd2f2622ed02ecbd0d16f07d49982c3743e1bc29..f63e0d1bf82c78486792018d581ffc1cce1f6e45 100644 (file)
@@ -49,7 +49,7 @@ extern void __libc_thread_freeres (void);
 /* Define and initialize `__progname' et. al.  */
 extern void __init_misc (int, char **, char **);
 
-# if IS_IN (rtld)
+# if IS_IN (rtld) && !defined NO_RTLD_HIDDEN
 extern __typeof (__profile_frequency) __profile_frequency attribute_hidden;
 # endif
 
index 5bf57703a98ecea381246873baefb837481db6a0..7d92538b3db1ea1f85700c08ba9b59f2fc6d41eb 100644 (file)
@@ -544,7 +544,7 @@ for linking")
 # define libc_hidden_data_ver(local, name)
 #endif
 
-#if IS_IN (rtld)
+#if IS_IN (rtld) && !defined NO_RTLD_HIDDEN
 # define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define rtld_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
 # define rtld_hidden_def(name) hidden_def (name)
index 90f46976e3c45a84a934b7d6d7989477ea9e8f80..45dcf6dd8e6e4aba5c02dc1af9ecea32471176d8 100644 (file)
@@ -25,7 +25,7 @@ libc_hidden_proto (__libc_longjmp)
 libc_hidden_proto (_setjmp)
 libc_hidden_proto (__sigsetjmp)
 
-# if IS_IN (rtld)
+# if IS_IN (rtld) && !defined NO_RTLD_HIDDEN
 extern __typeof (__sigsetjmp) __sigsetjmp attribute_hidden;
 # endif
 #endif
index bcf1455ae77086e282544ce45fc361357d4b8204..8feed8a0796d116a8a39ffb2b9d740a64bdd82f0 100644 (file)
@@ -53,7 +53,7 @@ extern int __xpg_sigpause (int sig);
 /* Allocate real-time signal with highest/lowest available priority.  */
 extern int __libc_allocate_rtsig (int __high);
 
-#  if IS_IN (rtld)
+#  if IS_IN (rtld) && !defined NO_RTLD_HIDDEN
 extern __typeof (__sigaction) __sigaction attribute_hidden;
 extern __typeof (__libc_sigaction) __libc_sigaction attribute_hidden;
 #  endif
index 6fd868828b0876b30c6c6520a1abaf62cc48bee7..3c9ca195779ffbf1c77b34e98b89c32089a1d495 100644 (file)
@@ -287,7 +287,7 @@ struct abort_msg_s
 extern struct abort_msg_s *__abort_msg;
 libc_hidden_proto (__abort_msg)
 
-# if IS_IN (rtld)
+# if IS_IN (rtld) && !defined NO_RTLD_HIDDEN
 extern __typeof (unsetenv) unsetenv attribute_hidden;
 extern __typeof (__strtoul_internal) __strtoul_internal attribute_hidden;
 # endif
index 069efd0b87010e5fdb64c87ced7af1dc4f54f232..450d7fa1d630b852f6c62aeaf3c04469d4669430 100644 (file)
@@ -142,7 +142,7 @@ libc_hidden_builtin_proto (strspn)
 libc_hidden_builtin_proto (strstr)
 libc_hidden_builtin_proto (ffs)
 
-#if IS_IN (rtld)
+#if IS_IN (rtld) && !defined NO_RTLD_HIDDEN
 extern __typeof (__stpcpy) __stpcpy attribute_hidden;
 extern __typeof (__strdup) __strdup attribute_hidden;
 extern __typeof (__strerror_r) __strerror_r attribute_hidden;
index 4f31c00ecaba221fae0e4f10fd1ed6fd6b17a92b..ca4c41183fb4b8b36d25eb18b3448cf3c8b9b3a1 100644 (file)
@@ -12,7 +12,7 @@ extern __mode_t __umask (__mode_t __mask);
 extern int __mkdir (const char *__path, __mode_t __mode);
 extern int __mknod (const char *__path,
                    __mode_t __mode, __dev_t __dev);
-#if IS_IN (libc) || IS_IN (rtld)
+#if IS_IN (libc) || (IS_IN (rtld) && !defined NO_RTLD_HIDDEN)
 hidden_proto (__fxstat)
 hidden_proto (__fxstat64)
 hidden_proto (__lxstat)
@@ -35,7 +35,7 @@ libc_hidden_proto (__xmknodat)
 libc_hidden_proto (__fxstatat)
 libc_hidden_proto (__fxstatat64)
 
-# if IS_IN (rtld)
+# if IS_IN (rtld) && !defined NO_RTLD_HIDDEN
 extern __typeof (__fxstatat64) __fxstatat64 attribute_hidden;
 # endif
 
index 14f4247dd4135d68c9ad4703a8dcf40c5edf3794..9ed5fa25657438a2f2c0c25999f607d86ff100db 100644 (file)
@@ -7,7 +7,7 @@ extern int __uname (struct utsname *__name);
 libc_hidden_proto (uname)
 libc_hidden_proto (__uname)
 
-# if IS_IN (rtld)
+# if IS_IN (rtld) && !defined NO_RTLD_HIDDEN
 extern __typeof (__uname) __uname attribute_hidden;
 # endif
 #endif
index a065ecb89014fbd2ab24d323fcb6153ea69e416e..6998c0859f82a36b8f748109a9e97369e92b4b8a 100644 (file)
@@ -46,7 +46,7 @@ extern char *_itoa (unsigned long long int value, char *buflim,
 
 extern const char _itoa_upper_digits[];
 extern const char _itoa_lower_digits[];
-#if IS_IN (libc) || IS_IN (rtld)
+#if IS_IN (libc) || (IS_IN (rtld) && !defined NO_RTLD_HIDDEN)
 hidden_proto (_itoa_upper_digits)
 hidden_proto (_itoa_lower_digits)
 #endif
index 551094fd88e3859de24971b3f76bf0377cdf76dc..1bda0c5bedb45c02d854a3215b69feebd794866d 100644 (file)
@@ -1,6 +1,6 @@
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
 
-$as_echo "#define NO_HIDDEN 1" >>confdefs.h
+$as_echo "#define NO_RTLD_HIDDEN 1" >>confdefs.h
 
 
 if test -n "$sysheaders"; then
index c61a5271ae266fba6741522dd1760491b56d88e9..ba4742aae47c5326d47fd6a04fa5ee5212405222 100644 (file)
@@ -3,7 +3,7 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 dnl We need this setting because of the need for PLT calls in ld.so.
 dnl See Roland's comment in
 dnl https://sourceware.org/bugzilla/show_bug.cgi?id=15605
-AC_DEFINE([NO_HIDDEN])
+AC_DEFINE([NO_RTLD_HIDDEN])
 
 if test -n "$sysheaders"; then
   OLD_CPPFLAGS=$CPPFLAGS