Index: glibc-2.26/include/libc-symbols.h
===================================================================
--- glibc-2.26.orig/include/libc-symbols.h
+++ glibc-2.26/include/libc-symbols.h
@@ -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: glibc-2.26/include/stdlib.h
===================================================================
--- glibc-2.26.orig/include/stdlib.h
+++ glibc-2.26/include/stdlib.h
@@ -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: glibc-2.26/sysdeps/mach/hurd/configure.ac
===================================================================
--- glibc-2.26.orig/sysdeps/mach/hurd/configure.ac
+++ glibc-2.26/sysdeps/mach/hurd/configure.ac
@@ -3,7 +3,7 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the
 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
Index: glibc-2.26/sysdeps/mach/hurd/configure
===================================================================
--- glibc-2.26.orig/sysdeps/mach/hurd/configure
+++ glibc-2.26/sysdeps/mach/hurd/configure
@@ -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: glibc-2.26/include/assert.h
===================================================================
--- glibc-2.26.orig/include/assert.h
+++ glibc-2.26/include/assert.h
@@ -20,7 +20,7 @@ extern void __assert_fail_base (const ch
 				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: glibc-2.26/include/dirent.h
===================================================================
--- glibc-2.26.orig/include/dirent.h
+++ glibc-2.26/include/dirent.h
@@ -76,7 +76,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: glibc-2.26/include/libc-internal.h
===================================================================
--- glibc-2.26.orig/include/libc-internal.h
+++ glibc-2.26/include/libc-internal.h
@@ -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: glibc-2.26/include/setjmp.h
===================================================================
--- glibc-2.26.orig/include/setjmp.h
+++ glibc-2.26/include/setjmp.h
@@ -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: glibc-2.26/include/signal.h
===================================================================
--- glibc-2.26.orig/include/signal.h
+++ glibc-2.26/include/signal.h
@@ -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: glibc-2.26/include/string.h
===================================================================
--- glibc-2.26.orig/include/string.h
+++ glibc-2.26/include/string.h
@@ -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: glibc-2.26/include/sys/stat.h
===================================================================
--- glibc-2.26.orig/include/sys/stat.h
+++ glibc-2.26/include/sys/stat.h
@@ -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: glibc-2.26/include/sys/utsname.h
===================================================================
--- glibc-2.26.orig/include/sys/utsname.h
+++ glibc-2.26/include/sys/utsname.h
@@ -7,7 +7,7 @@ extern int __uname (struct utsname *__na
 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: glibc-2.26/sysdeps/generic/_itoa.h
===================================================================
--- glibc-2.26.orig/sysdeps/generic/_itoa.h
+++ glibc-2.26/sysdeps/generic/_itoa.h
@@ -46,7 +46,7 @@ extern char *_itoa (unsigned long long i
 
 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: glibc-2.26/config.h.in
===================================================================
--- glibc-2.26.orig/config.h.in
+++ glibc-2.26/config.h.in
@@ -93,6 +93,10 @@
    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
 
