about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-10-28 06:44:41 +0000
committerUlrich Drepper <drepper@redhat.com>2006-10-28 06:44:41 +0000
commit78fbd00f39d48592d55bd4a022a909c9577b21db (patch)
tree2bf24b213e2eeb96c06422c63ed4108db191e78e
parenteb0a3d0cab507fecefe390a340f74ab8e5cf7831 (diff)
downloadglibc-78fbd00f39d48592d55bd4a022a909c9577b21db.tar.gz
glibc-78fbd00f39d48592d55bd4a022a909c9577b21db.tar.xz
glibc-78fbd00f39d48592d55bd4a022a909c9577b21db.zip
* configure.in: Require assembler support for visibility, compiler
	support for visibility and aliases, linker support for various -z
	options.
	* Makeconfig: Remove conditional code which now is unnecessary.
	* config.h.in: Likewise.
	* config.make.in: Likewise.
	* dlfcn/Makefile: Likewise.
	* elf/Makefile: Likewise.
	* elf/dl-load.c: Likewise.
	* elf/rtld.c: Likewise.
	* include/libc-symbols.h: Likewise.
	* include/stdio.h: Likewise.
	* io/Makefile: Likewise.
	* io/fstat.c: Likewise.
	* io/fstat64.c: Likewise.
	* io/fstatat.c: Likewise.
	* io/fstatat64.c: Likewise.
	* io/lstat.c: Likewise.
	* io/lstat64.c: Likewise.
	* io/mknod.c: Likewise.
	* io/mknodat.c: Likewise.
	* io/stat.c: Likewise.
	* io/stat64.c: Likewise.
	* libio/stdio.c: Likewise.
	* nscd/Makefile: Likewise.
	* stdlib/Makefile: Likewise.
	* stdlib/atexit.c: Likewise.
	* sysdeps/generic/ldsodefs.h: Likewise.
	* sysdeps/i386/dl-machine.h: Likewise.
	* sysdeps/i386/sysdep.h: Likewise.
	* sysdeps/i386/i686/memcmp.S: Likewise.
	* sysdeps/powerpc/powerpc32/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sigaction.c: Likewise.
-rw-r--r--ChangeLog35
-rw-r--r--Makeconfig2
-rw-r--r--config.h.in20
-rw-r--r--config.make.in5
-rwxr-xr-xconfigure68
-rw-r--r--configure.in27
-rw-r--r--dlfcn/Makefile5
-rw-r--r--elf/Makefile14
-rw-r--r--elf/dl-load.c5
-rw-r--r--elf/rtld.c3
-rw-r--r--include/libc-symbols.h34
-rw-r--r--include/stdio.h1
-rw-r--r--io/Makefile13
-rw-r--r--io/fstat.c12
-rw-r--r--io/fstat64.c9
-rw-r--r--io/fstatat.c9
-rw-r--r--io/fstatat64.c9
-rw-r--r--io/lstat.c12
-rw-r--r--io/lstat64.c9
-rw-r--r--io/mknod.c12
-rw-r--r--io/mknodat.c10
-rw-r--r--io/stat.c12
-rw-r--r--io/stat64.c9
-rw-r--r--libio/stdio.c10
-rw-r--r--nscd/Makefile2
-rw-r--r--stdlib/Makefile4
-rw-r--r--stdlib/atexit.c9
-rw-r--r--sysdeps/generic/ldsodefs.h20
-rw-r--r--sysdeps/i386/dl-machine.h4
-rw-r--r--sysdeps/i386/i686/memcmp.S6
-rw-r--r--sysdeps/i386/sysdep.h14
-rw-r--r--sysdeps/powerpc/powerpc32/sysdep.h2
-rw-r--r--sysdeps/unix/sysv/linux/configure27
-rw-r--r--sysdeps/unix/sysv/linux/i386/sigaction.c14
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sigaction.c7
35 files changed, 166 insertions, 288 deletions
diff --git a/ChangeLog b/ChangeLog
index 554d8776e7..8159aa4246 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,40 @@
 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
 
+	* configure.in: Require assembler support for visibility, compiler
+	support for visibility and aliases, linker support for various -z
+	options.
+	* Makeconfig: Remove conditional code which now is unnecessary.
+	* config.h.in: Likewise.
+	* config.make.in: Likewise.
+	* dlfcn/Makefile: Likewise.
+	* elf/Makefile: Likewise.
+	* elf/dl-load.c: Likewise.
+	* elf/rtld.c: Likewise.
+	* include/libc-symbols.h: Likewise.
+	* include/stdio.h: Likewise.
+	* io/Makefile: Likewise.
+	* io/fstat.c: Likewise.
+	* io/fstat64.c: Likewise.
+	* io/fstatat.c: Likewise.
+	* io/fstatat64.c: Likewise.
+	* io/lstat.c: Likewise.
+	* io/lstat64.c: Likewise.
+	* io/mknod.c: Likewise.
+	* io/mknodat.c: Likewise.
+	* io/stat.c: Likewise.
+	* io/stat64.c: Likewise.
+	* libio/stdio.c: Likewise.
+	* nscd/Makefile: Likewise.
+	* stdlib/Makefile: Likewise.
+	* stdlib/atexit.c: Likewise.
+	* sysdeps/generic/ldsodefs.h: Likewise.
+	* sysdeps/i386/dl-machine.h: Likewise.
+	* sysdeps/i386/sysdep.h: Likewise.
+	* sysdeps/i386/i686/memcmp.S: Likewise.
+	* sysdeps/powerpc/powerpc32/sysdep.h: Likewise.
+	* sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/sigaction.c: Likewise.
+
 	* Makerules: USE_TLS support is now default.
 	* tls.make.c: Likewise.
 	* csu/Versions: Likewise.
diff --git a/Makeconfig b/Makeconfig
index 5a1aebccff..349f94d9ac 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -407,11 +407,9 @@ LDFLAGS.so += $(combreloc-LDFLAGS)
 LDFLAGS-rtld += $(combreloc-LDFLAGS)
 endif
 
-ifeq (yes,$(have-z-relro))
 relro-LDFLAGS = -Wl,-z,relro
 LDFLAGS.so += $(relro-LDFLAGS)
 LDFLAGS-rtld += $(relro-LDFLAGS)
-endif
 
 ifeq (yes,$(have-hash-style))
 # For the time being we unconditionally use 'both'.  At some time we
diff --git a/config.h.in b/config.h.in
index da973f6a5d..a46e405269 100644
--- a/config.h.in
+++ b/config.h.in
@@ -120,23 +120,6 @@
 /* Define if the linker supports the -z combreloc option.  */
 #undef	HAVE_Z_COMBRELOC
 
-/* Define if the assembler supported .protected.  */
-#undef	HAVE_PROTECTED
-
-/* Define if the assembler supported .hidden.  */
-#undef	HAVE_HIDDEN
-
-/* Define if the compiler supports __attribute__ ((visibility (...))).  */
-#undef	HAVE_VISIBILITY_ATTRIBUTE
-
-/* Define if the compiler doesn't support __attribute__ ((visibility (...)))
-   together with __asm__ redirection properly.  */
-#undef	HAVE_BROKEN_VISIBILITY_ATTRIBUTE
-
-/* Define if the compiler doesn't support __attribute__ ((alias (...)))
-   together with __asm__ redirection properly.  */
-#undef	HAVE_BROKEN_ALIAS_ATTRIBUTE
-
 /* Define if _rtld_local structure should be forced into .sdata section.  */
 #undef	HAVE_SDATA_SECTION
 
@@ -188,9 +171,6 @@
 /* Defined if forced unwind support is available.  */
 #undef	HAVE_FORCED_UNWIND
 
-/* Defined if the linker supports the -z relro option.  */
-#undef HAVE_Z_RELRO
-
 /* Defined of libidn is available.  */
 #undef HAVE_LIBIDN
 
diff --git a/config.make.in b/config.make.in
index 677da3a891..7aa9c1c12d 100644
--- a/config.make.in
+++ b/config.make.in
@@ -38,14 +38,9 @@ c++-sysincludes = @CXX_SYSINCLUDES@
 all-warnings = @all_warnings@
 
 elf = @elf@
-have-protected = @libc_cv_asm_protected_directive@
-have-z-nodelete = @libc_cv_z_nodelete@
-have-z-nodlopen = @libc_cv_z_nodlopen@
-have-z-initfirst = @libc_cv_z_initfirst@
 have-z-combreloc = @libc_cv_z_combreloc@
 have-z-execstack = @libc_cv_z_execstack@
 have-initfini = @libc_cv_have_initfini@
-have-z-relro = @libc_cv_z_relro@
 have-Bgroup = @libc_cv_Bgroup@
 have-as-needed = @libc_cv_as_needed@
 libgcc_s_suffix = @libc_cv_libgcc_s_suffix@
diff --git a/configure b/configure
index 8bd2144a8b..b04bf8b71d 100755
--- a/configure
+++ b/configure
@@ -313,7 +313,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons add_on_subdirs base_machine submachine sysnames sysdeps_add_ons INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES CXX_SYSINCLUDES libc_cv_gcc_static_libgcc BASH libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_asm_protected_directive libc_cv_cc_with_libunwind libc_cv_z_nodelete libc_cv_z_nodlopen libc_cv_z_initfirst libc_cv_z_relro libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie libc_cv_hashstyle fno_unit_at_a_time libc_cv_ssp libc_cv_have_initfini no_whole_archive exceptions LIBGD have_libaudit have_libcap have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite_script elf xcoff static shared pic_default profile omitfp bounded static_nss nopic_initfini DEFINES mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons add_on_subdirs base_machine submachine sysnames sysdeps_add_ons INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES CXX_SYSINCLUDES libc_cv_gcc_static_libgcc BASH libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_cc_with_libunwind libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie libc_cv_hashstyle fno_unit_at_a_time libc_cv_ssp libc_cv_have_initfini no_whole_archive exceptions LIBGD have_libaudit have_libcap have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite_script elf xcoff static shared pic_default profile omitfp bounded static_nss nopic_initfini DEFINES mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -5339,22 +5339,15 @@ EOF
   (exit $ac_status); }; }; then
     libc_cv_asm_protected_directive=yes
   else
-    libc_cv_asm_protected_directive=no
+    { { echo "$as_me:$LINENO: error: assembler support for symbol visibility is required" >&5
+echo "$as_me: error: assembler support for symbol visibility is required" >&2;}
+   { (exit 1); exit 1; }; }
   fi
   rm -f conftest*
 fi
 echo "$as_me:$LINENO: result: $libc_cv_asm_protected_directive" >&5
 echo "${ECHO_T}$libc_cv_asm_protected_directive" >&6
 
-  cat >>confdefs.h <<\_ACEOF
-#define HAVE_PROTECTED 1
-_ACEOF
-
-  cat >>confdefs.h <<\_ACEOF
-#define HAVE_HIDDEN 1
-_ACEOF
-
-
   if test $libc_cv_asm_protected_directive = yes; then
     echo "$as_me:$LINENO: checking whether __attribute__((visibility())) is supported" >&5
 echo $ECHO_N "checking whether __attribute__((visibility())) is supported... $ECHO_C" >&6
@@ -5383,11 +5376,10 @@ EOF
 fi
 echo "$as_me:$LINENO: result: $libc_cv_visibility_attribute" >&5
 echo "${ECHO_T}$libc_cv_visibility_attribute" >&6
-    if test $libc_cv_visibility_attribute = yes; then
-      cat >>confdefs.h <<\_ACEOF
-#define HAVE_VISIBILITY_ATTRIBUTE 1
-_ACEOF
-
+    if test $libc_cv_visibility_attribute != yes; then
+      { { echo "$as_me:$LINENO: error: compiler support for visibility attribute is required" >&5
+echo "$as_me: error: compiler support for visibility attribute is required" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -5419,10 +5411,9 @@ fi
 echo "$as_me:$LINENO: result: $libc_cv_broken_visibility_attribute" >&5
 echo "${ECHO_T}$libc_cv_broken_visibility_attribute" >&6
     if test $libc_cv_broken_visibility_attribute = yes; then
-      cat >>confdefs.h <<\_ACEOF
-#define HAVE_BROKEN_VISIBILITY_ATTRIBUTE 1
-_ACEOF
-
+      { { echo "$as_me:$LINENO: error: working compiler support for visibility attribute is required" >&5
+echo "$as_me: error: working compiler support for visibility attribute is required" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -5457,10 +5448,9 @@ fi
 echo "$as_me:$LINENO: result: $libc_cv_broken_alias_attribute" >&5
 echo "${ECHO_T}$libc_cv_broken_alias_attribute" >&6
   if test $libc_cv_broken_alias_attribute = yes; then
-    cat >>confdefs.h <<\_ACEOF
-#define HAVE_BROKEN_ALIAS_ATTRIBUTE 1
-_ACEOF
-
+    { { echo "$as_me:$LINENO: error: working alias attribute support required" >&5
+echo "$as_me: error: working alias attribute support required" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   if test $libc_cv_visibility_attribute = yes; then
@@ -5572,14 +5562,15 @@ EOF
   then
     libc_cv_z_nodelete=yes
   else
-    libc_cv_z_nodelete=no
+    { { echo "$as_me:$LINENO: error: linker with -z nodelete support required" >&5
+echo "$as_me: error: linker with -z nodelete support required" >&2;}
+   { (exit 1); exit 1; }; }
   fi
   rm -f conftest*
 fi
 echo "$as_me:$LINENO: result: $libc_cv_z_nodelete" >&5
 echo "${ECHO_T}$libc_cv_z_nodelete" >&6
 
-
   echo "$as_me:$LINENO: checking for -z nodlopen option" >&5
 echo $ECHO_N "checking for -z nodlopen option... $ECHO_C" >&6
 if test "${libc_cv_z_nodlopen+set}" = set; then
@@ -5600,14 +5591,15 @@ EOF
   then
     libc_cv_z_nodlopen=yes
   else
-    libc_cv_z_nodlopen=no
+    { { echo "$as_me:$LINENO: error: linker with -z nodlopen support required" >&5
+echo "$as_me: error: linker with -z nodlopen support required" >&2;}
+   { (exit 1); exit 1; }; }
   fi
   rm -f conftest*
 fi
 echo "$as_me:$LINENO: result: $libc_cv_z_nodlopen" >&5
 echo "${ECHO_T}$libc_cv_z_nodlopen" >&6
 
-
   echo "$as_me:$LINENO: checking for -z initfirst option" >&5
 echo $ECHO_N "checking for -z initfirst option... $ECHO_C" >&6
 if test "${libc_cv_z_initfirst+set}" = set; then
@@ -5628,14 +5620,15 @@ EOF
   then
     libc_cv_z_initfirst=yes
   else
-    libc_cv_z_initfirst=no
+    { { echo "$as_me:$LINENO: error: linker with -z initfirst support required" >&5
+echo "$as_me: error: linker with -z initfirst support required" >&2;}
+   { (exit 1); exit 1; }; }
   fi
   rm -f conftest*
 fi
 echo "$as_me:$LINENO: result: $libc_cv_z_initfirst" >&5
 echo "${ECHO_T}$libc_cv_z_initfirst" >&6
 
-
   echo "$as_me:$LINENO: checking for -z relro option" >&5
 echo $ECHO_N "checking for -z relro option... $ECHO_C" >&6
 if test "${libc_cv_z_relro+set}" = set; then
@@ -5662,12 +5655,10 @@ else
 fi
 echo "$as_me:$LINENO: result: $libc_cv_z_relro" >&5
 echo "${ECHO_T}$libc_cv_z_relro" >&6
-
-  if test $libc_cv_z_relro = yes; then
-    cat >>confdefs.h <<\_ACEOF
-#define HAVE_Z_RELRO 1
-_ACEOF
-
+  if test $libc_cv_z_relro != yes; then
+    { { echo "$as_me:$LINENO: error: linker with -z relro support required" >&5
+echo "$as_me: error: linker with -z relro support required" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   echo "$as_me:$LINENO: checking for -Bgroup option" >&5
@@ -8510,12 +8501,7 @@ s,@PERL@,$PERL,;t t
 s,@INSTALL_INFO@,$INSTALL_INFO,;t t
 s,@BISON@,$BISON,;t t
 s,@VERSIONING@,$VERSIONING,;t t
-s,@libc_cv_asm_protected_directive@,$libc_cv_asm_protected_directive,;t t
 s,@libc_cv_cc_with_libunwind@,$libc_cv_cc_with_libunwind,;t t
-s,@libc_cv_z_nodelete@,$libc_cv_z_nodelete,;t t
-s,@libc_cv_z_nodlopen@,$libc_cv_z_nodlopen,;t t
-s,@libc_cv_z_initfirst@,$libc_cv_z_initfirst,;t t
-s,@libc_cv_z_relro@,$libc_cv_z_relro,;t t
 s,@libc_cv_Bgroup@,$libc_cv_Bgroup,;t t
 s,@libc_cv_libgcc_s_suffix@,$libc_cv_libgcc_s_suffix,;t t
 s,@libc_cv_as_needed@,$libc_cv_as_needed,;t t
diff --git a/configure.in b/configure.in
index 6a7e51d853..fb43804b1f 100644
--- a/configure.in
+++ b/configure.in
@@ -1259,12 +1259,9 @@ EOF
   if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
     libc_cv_asm_protected_directive=yes
   else
-    libc_cv_asm_protected_directive=no
+    AC_MSG_ERROR(assembler support for symbol visibility is required)
   fi
   rm -f conftest*])
-  AC_SUBST(libc_cv_asm_protected_directive)
-  AC_DEFINE(HAVE_PROTECTED)
-  AC_DEFINE(HAVE_HIDDEN)
 
   if test $libc_cv_asm_protected_directive = yes; then
     AC_CACHE_CHECK(whether __attribute__((visibility())) is supported,
@@ -1283,8 +1280,8 @@ EOF
 		  fi
 		  rm -f conftest.[cs]
 		 ])
-    if test $libc_cv_visibility_attribute = yes; then
-      AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
+    if test $libc_cv_visibility_attribute != yes; then
+      AC_MSG_ERROR(compiler support for visibility attribute is required)
     fi
   fi
 
@@ -1307,7 +1304,7 @@ changequote([,])dnl
 		  rm -f conftest.c conftest.s
 		 ])
     if test $libc_cv_broken_visibility_attribute = yes; then
-      AC_DEFINE(HAVE_BROKEN_VISIBILITY_ATTRIBUTE)
+      AC_MSG_ERROR(working compiler support for visibility attribute is required)
     fi
   fi
 
@@ -1331,7 +1328,7 @@ EOF
 		  rm -f conftest.c conftest.s
 		 ])
   if test $libc_cv_broken_alias_attribute = yes; then
-    AC_DEFINE(HAVE_BROKEN_ALIAS_ATTRIBUTE)
+    AC_MSG_ERROR(working alias attribute support required)
   fi
 
   if test $libc_cv_visibility_attribute = yes; then
@@ -1403,10 +1400,9 @@ EOF
   then
     libc_cv_z_nodelete=yes
   else
-    libc_cv_z_nodelete=no
+    AC_MSG_ERROR(linker with -z nodelete support required)
   fi
   rm -f conftest*])
-  AC_SUBST(libc_cv_z_nodelete)
 
   AC_CACHE_CHECK(for -z nodlopen option,
 		 libc_cv_z_nodlopen, [dnl
@@ -1420,10 +1416,9 @@ EOF
   then
     libc_cv_z_nodlopen=yes
   else
-    libc_cv_z_nodlopen=no
+    AC_MSG_ERROR(linker with -z nodlopen support required)
   fi
   rm -f conftest*])
-  AC_SUBST(libc_cv_z_nodlopen)
 
   AC_CACHE_CHECK(for -z initfirst option,
 		 libc_cv_z_initfirst, [dnl
@@ -1437,10 +1432,9 @@ EOF
   then
     libc_cv_z_initfirst=yes
   else
-    libc_cv_z_initfirst=no
+    AC_MSG_ERROR(linker with -z initfirst support required)
   fi
   rm -f conftest*])
-  AC_SUBST(libc_cv_z_initfirst)
 
   AC_CACHE_CHECK(for -z relro option,
 		 libc_cv_z_relro, [dnl
@@ -1452,9 +1446,8 @@ EOF
       libc_cv_z_relro=yes
     fi
   fi])
-  AC_SUBST(libc_cv_z_relro)
-  if test $libc_cv_z_relro = yes; then
-    AC_DEFINE(HAVE_Z_RELRO)
+  if test $libc_cv_z_relro != yes; then
+    AC_MSG_ERROR(linker with -z relro support required)
   fi
 
   AC_CACHE_CHECK(for -Bgroup option,
diff --git a/dlfcn/Makefile b/dlfcn/Makefile
index 63e7b31b2a..e8fbab2958 100644
--- a/dlfcn/Makefile
+++ b/dlfcn/Makefile
@@ -41,10 +41,7 @@ endif
 ifeq (yes,$(build-shared))
 tests = glrefmain failtest tst-dladdr default errmsg1 tstcxaatexit \
 	bug-dlopen1 bug-dlsym1 tst-dlinfo bug-atexit1 bug-atexit2 \
-	bug-atexit3
-ifeq (yes,$(have-protected))
-tests += tstatexit
-endif
+	bug-atexit3 tstatexit
 endif
 modules-names = glreflib1 glreflib2 failtestmod defaultmod1 defaultmod2 \
 		errmsg1mod modatexit modcxaatexit \
diff --git a/elf/Makefile b/elf/Makefile
index 06e376d803..afebaec1ec 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -159,8 +159,8 @@ endif
 ifeq (yes,$(build-shared))
 tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
 	 constload1 order $(tests-vis-$(have-protected)) noload filter unload \
-	 reldep reldep2 reldep3 reldep4 $(tests-nodelete-$(have-z-nodelete)) \
-	 $(tests-nodlopen-$(have-z-nodlopen)) neededtest neededtest2 \
+	 reldep reldep2 reldep3 reldep4 nodelete nodelete2 \
+	 nodlopen nodlopen2 neededtest neededtest2 \
 	 neededtest3 neededtest4 unload2 lateglobal initfirst global \
 	 restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \
 	 circleload1 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 \
@@ -175,8 +175,6 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
 #	 reldep9
 test-srcs = tst-pathopt
 tests-vis-yes = vismain
-tests-nodelete-yes = nodelete nodelete2
-tests-nodlopen-yes = nodlopen nodlopen2
 tests-execstack-yes = tst-execstack tst-execstack-needed tst-execstack-prog
 endif
 ifeq (yesyes,$(have-fpie)$(build-shared))
@@ -186,8 +184,9 @@ tests: $(objpfx)tst-leaks1-mem
 modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
 		testobj1_1 failobj constload2 constload3 unloadmod \
 		dep1 dep2 dep3 dep4 $(modules-vis-$(have-protected)) \
-		$(modules-nodelete-$(have-z-nodelete)) \
-		$(modules-nodlopen-$(have-z-nodlopen)) filtmod1 filtmod2 \
+		nodelmod1 nodelmod2 nodelmod3 nodelmod4 \
+		nodel2mod1 nodel2mod2 nodel2mod3 \
+		nodlopenmod nodlopenmod2 filtmod1 filtmod2 \
 		reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \
 		reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \
 		neededobj1 neededobj2 neededobj3 neededobj4 \
@@ -221,9 +220,6 @@ ifeq (yesyes,$(have-fpie)$(build-shared))
 modules-names += tst-piemod1
 endif
 modules-vis-yes = vismod1 vismod2 vismod3
-modules-nodelete-yes = nodelmod1 nodelmod2 nodelmod3 nodelmod4 \
-		       nodel2mod1 nodel2mod2 nodel2mod3
-modules-nodlopen-yes = nodlopenmod nodlopenmod2
 modules-execstack-yes = tst-execstack-mod
 extra-test-objs += $(addsuffix .os,$(strip $(modules-names)))
 # We need this variable to be sure the test modules get the right CPPFLAGS.
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 2adeb60fcd..ccbbf4fdd2 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1392,7 +1392,7 @@ cannot allocate TLS data structures for initial thread");
 	 requires that it be executable.  We must change the
 	 protection of the variable which contains the flags used in
 	 the mprotect calls.  */
-#if defined HAVE_Z_RELRO && defined SHARED
+#ifdef SHARED
       if ((mode & (__RTLD_DLOPEN | __RTLD_AUDIT)) == __RTLD_DLOPEN)
 	{
 	  const uintptr_t p = (uintptr_t) &__stack_prot & -GLRO(dl_pagesize);
@@ -1935,11 +1935,10 @@ open_path (const char *name, size_t namelen, int preloaded,
 	 must not be freed using the general free() in libc.  */
       if (sps->malloced)
 	free (sps->dirs);
-#ifdef HAVE_Z_RELRO
+
       /* rtld_search_dirs is attribute_relro, therefore avoid writing
 	 into it.  */
       if (sps != &rtld_search_dirs)
-#endif
 	sps->dirs = (void *) -1;
     }
 
diff --git a/elf/rtld.c b/elf/rtld.c
index edcc1f7e92..5e6ee51603 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -207,8 +207,7 @@ DL_SYSINFO_IMPLEMENTATION
    is fine, too.  The latter is important here.  We can avoid setting
    up a temporary link map for ld.so if we can mark _rtld_global as
    hidden.  */
-#if defined PI_STATIC_AND_HIDDEN && defined HAVE_HIDDEN \
-    && defined HAVE_VISIBILITY_ATTRIBUTE
+#ifdef PI_STATIC_AND_HIDDEN
 # define DONT_USE_BOOTSTRAP_MAP	1
 #endif
 
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index da46f5e804..9eabcbd354 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -114,6 +114,13 @@
 #  define _weak_alias(name, aliasname) \
   extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
 
+/* Same as WEAK_ALIAS, but mark symbol as hidden.  */
+#  define weak_hidden_alias(name, aliasname) \
+  _weak_hidden_alias (name, aliasname)
+#  define _weak_hidden_alias(name, aliasname) \
+  extern __typeof (name) aliasname \
+    __attribute__ ((weak, alias (#name), __visibility__ ("hidden")));
+
 /* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined).  */
 #  define weak_extern(symbol) _weak_extern (weak symbol)
 #  define _weak_extern(expr) _Pragma (#expr)
@@ -121,6 +128,7 @@
 # else
 
 #  define weak_alias(name, aliasname) strong_alias(name, aliasname)
+#  define weak_hidden_alias(name, aliasname) strong_alias(name, aliasname)
 #  define weak_extern(symbol) /* Nothing. */
 
 # endif
@@ -431,8 +439,7 @@ for linking")
   strong_alias(real, name)
 #endif
 
-#if defined HAVE_VISIBILITY_ATTRIBUTE \
-    && (defined SHARED || defined LIBC_NONSHARED)
+#if defined SHARED || defined LIBC_NONSHARED
 # define attribute_hidden __attribute__ ((visibility ("hidden")))
 #else
 # define attribute_hidden
@@ -444,11 +451,7 @@ for linking")
 # define attribute_tls_model_ie
 #endif
 
-#ifdef HAVE_Z_RELRO
-# define attribute_relro __attribute__ ((section (".data.rel.ro")))
-#else
-# define attribute_relro
-#endif
+#define attribute_relro __attribute__ ((section (".data.rel.ro")))
 
 /* Handling on non-exported internal names.  We have to do this only
    for shared code.  */
@@ -457,14 +460,9 @@ for linking")
 # define INTDEF(name) strong_alias (name, name##_internal)
 # define INTVARDEF(name) \
   _INTVARDEF (name, name##_internal)
-# if defined HAVE_VISIBILITY_ATTRIBUTE
-#  define _INTVARDEF(name, aliasname) \
+# define _INTVARDEF(name, aliasname) \
   extern __typeof (name) aliasname __attribute__ ((alias (#name), \
 						   visibility ("hidden")));
-# else
-#  define _INTVARDEF(name, aliasname) \
-  extern __typeof (name) aliasname __attribute__ ((alias (#name)));
-# endif
 # define INTDEF2(name, newname) strong_alias (name, newname##_internal)
 # define INTVARDEF2(name, newname) _INTVARDEF (name, newname##_internal)
 #else
@@ -549,16 +547,10 @@ for linking")
    versioned_symbol (libc, __real_foo, foo, GLIBC_2_1);
    libc_hidden_ver (__real_foo, foo)  */
 
-#if defined SHARED && defined DO_VERSIONING \
-    && !defined HAVE_BROKEN_ALIAS_ATTRIBUTE && !defined NO_HIDDEN
+#if defined SHARED && defined DO_VERSIONING && !defined NO_HIDDEN
 # ifndef __ASSEMBLER__
-#  if !defined HAVE_VISIBILITY_ATTRIBUTE \
-      || defined HAVE_BROKEN_VISIBILITY_ATTRIBUTE
-#   define __hidden_proto_hiddenattr(attrs...)
-#  else
-#   define __hidden_proto_hiddenattr(attrs...) \
+#  define __hidden_proto_hiddenattr(attrs...) \
   __attribute__ ((visibility ("hidden"), ##attrs))
-#  endif
 #  define hidden_proto(name, attrs...) \
   __hidden_proto (name, __GI_##name, ##attrs)
 #  define __hidden_proto(name, internal, attrs...) \
diff --git a/include/stdio.h b/include/stdio.h
index e040380d79..b293b8f1c7 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -131,7 +131,6 @@ libc_hidden_proto (__vsnprintf_chk)
 libc_hidden_proto (__vfprintf_chk)
 
 #  if !defined NOT_IN_libc && defined SHARED && defined DO_VERSIONING \
-  && defined HAVE_VISIBILITY_ATTRIBUTE && !defined HAVE_BROKEN_ALIAS_ATTRIBUTE\
   && !defined NO_HIDDEN
 /* Special gcc builtins.  */
 extern size_t __builtin_fwrite (const void *, size_t, size_t, void *)
diff --git a/io/Makefile b/io/Makefile
index c06d747d4a..4aadfbca01 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -90,19 +90,6 @@ CFLAGS-posix_fallocate64.c = -fexceptions
 CFLAGS-test-stat.c = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
 CFLAGS-test-lfs.c = -D_LARGEFILE64_SOURCE
 
-ifeq (yes,$(have-protected))
-CFLAGS-stat.c = -DHAVE_DOT_HIDDEN
-CFLAGS-fstat.c = -DHAVE_DOT_HIDDEN
-CFLAGS-lstat.c = -DHAVE_DOT_HIDDEN
-CFLAGS-mknod.c = -DHAVE_DOT_HIDDEN
-CFLAGS-stat64.c = -DHAVE_DOT_HIDDEN
-CFLAGS-fstat64.c = -DHAVE_DOT_HIDDEN
-CFLAGS-lstat64.c = -DHAVE_DOT_HIDDEN
-CFLAGS-fstatat.c = -DHAVE_DOT_HIDDEN
-CFLAGS-fstatat64.c = -DHAVE_DOT_HIDDEN
-CFLAGS-mknodat.c = -DHAVE_DOT_HIDDEN
-endif
-
 test-stat2-ARGS = Makefile . $(objpfx)test-stat2
 
 tst-statvfs-ARGS = $(objpfx)tst-statvfs tst-statvfs.c /tmp
diff --git a/io/fstat.c b/io/fstat.c
index 0f95c1a6e2..e2f9abd384 100644
--- a/io/fstat.c
+++ b/io/fstat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 2001, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -47,16 +47,10 @@
 #undef fstat
 #undef __fstat
 int
+attribute_hidden
 __fstat (int fd, struct stat *buf)
 {
   return __fxstat (_STAT_VER, fd, buf);
 }
 
-weak_alias (__fstat, fstat)
-
-/* Hide the symbol so that no definition but the one locally in the
-   executable or DSO is used.  */
-#ifdef HAVE_DOT_HIDDEN
-asm (".hidden\tfstat");
-asm (".hidden\t__fstat");
-#endif
+weak_hidden_alias (__fstat, fstat)
diff --git a/io/fstat64.c b/io/fstat64.c
index 79bd967d8f..fe655444b2 100644
--- a/io/fstat64.c
+++ b/io/fstat64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 2001, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -46,13 +46,8 @@
 
 #undef fstat64
 int
+attribute_hidden
 fstat64 (int fd, struct stat64 *buf)
 {
   return __fxstat64 (_STAT_VER, fd, buf);
 }
-
-/* Hide the symbol so that no definition but the one locally in the
-   executable or DSO is used.  */
-#ifdef HAVE_DOT_HIDDEN
-asm (".hidden\tfstat64");
-#endif
diff --git a/io/fstatat.c b/io/fstatat.c
index 1ac80597a0..abf083c72e 100644
--- a/io/fstatat.c
+++ b/io/fstatat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -46,13 +46,8 @@
 
 #undef fstatat
 int
+attribute_hidden
 fstatat (int fd, const char *file, struct stat *buf, int flag)
 {
   return __fxstatat (_STAT_VER, fd, file, buf, flag);
 }
-
-/* Hide the symbol so that no definition but the one locally in the
-   executable or DSO is used.  */
-#ifdef HAVE_DOT_HIDDEN
-asm (".hidden\tfstatat");
-#endif
diff --git a/io/fstatat64.c b/io/fstatat64.c
index a14b42d42e..6fdf709af5 100644
--- a/io/fstatat64.c
+++ b/io/fstatat64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -46,13 +46,8 @@
 
 #undef fstatat64
 int
+attribute_hidden
 fstatat64 (int fd, const char *file, struct stat64 *buf, int flag)
 {
   return __fxstatat64 (_STAT_VER, fd, file, buf, flag);
 }
-
-/* Hide the symbol so that no definition but the one locally in the
-   executable or DSO is used.  */
-#ifdef HAVE_DOT_HIDDEN
-asm (".hidden\tfstatat64");
-#endif
diff --git a/io/lstat.c b/io/lstat.c
index c4d7abe2c2..620e47877a 100644
--- a/io/lstat.c
+++ b/io/lstat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 2001, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -47,16 +47,10 @@
 #undef lstat
 #undef __lstat
 int
+attribute_hidden
 __lstat (const char *file, struct stat *buf)
 {
   return __lxstat (_STAT_VER, file, buf);
 }
 
-weak_alias (__lstat, lstat)
-
-/* Hide the symbol so that no definition but the one locally in the
-   executable or DSO is used.  */
-#ifdef HAVE_DOT_HIDDEN
-asm (".hidden\tlstat");
-asm (".hidden\t__lstat");
-#endif
+weak_hidden_alias (__lstat, lstat)
diff --git a/io/lstat64.c b/io/lstat64.c
index 8a994e4867..3e4ba2d972 100644
--- a/io/lstat64.c
+++ b/io/lstat64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 2001, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -46,13 +46,8 @@
 
 #undef lstat64
 int
+attribute_hidden
 lstat64 (const char *file, struct stat64 *buf)
 {
   return __lxstat64 (_STAT_VER, file, buf);
 }
-
-/* Hide the symbol so that no definition but the one locally in the
-   executable or DSO is used.  */
-#ifdef HAVE_DOT_HIDDEN
-asm (".hidden\tlstat64");
-#endif
diff --git a/io/mknod.c b/io/mknod.c
index 7d43593a25..cc5fd26105 100644
--- a/io/mknod.c
+++ b/io/mknod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 2001, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -47,16 +47,10 @@
    all callers.  */
 
 int
+attribute_hidden
 __mknod (const char *path, mode_t mode, dev_t dev)
 {
   return __xmknod (_MKNOD_VER, path, mode, &dev);
 }
 
-weak_alias (__mknod, mknod)
-
-/* Hide the symbol so that no definition but the one locally in the
-   executable or DSO is used.  */
-#ifdef HAVE_DOT_HIDDEN
-asm (".hidden\tmknod");
-asm (".hidden\t__mknod");
-#endif
+weak_hidden_alias (__mknod, mknod)
diff --git a/io/mknodat.c b/io/mknodat.c
index ac515b5b48..b02ba695f9 100644
--- a/io/mknodat.c
+++ b/io/mknodat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 2001, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 2001, 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -47,14 +47,8 @@
    all callers.  */
 
 int
+attribute_hidden
 mknodat (int fd, const char *path, mode_t mode, dev_t dev)
 {
   return __xmknodat (_MKNOD_VER, fd, path, mode, &dev);
 }
-
-
-/* Hide the symbol so that no definition but the one locally in the
-   executable or DSO is used.  */
-#ifdef HAVE_DOT_HIDDEN
-asm (".hidden\tmknodat");
-#endif
diff --git a/io/stat.c b/io/stat.c
index 6af604957e..6f1c28fc56 100644
--- a/io/stat.c
+++ b/io/stat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 2001, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -46,16 +46,10 @@
 
 #undef stat
 int
+attribute_hidden
 __stat (const char *file, struct stat *buf)
 {
   return __xstat (_STAT_VER, file, buf);
 }
 
-weak_alias (__stat, stat)
-
-/* Hide the symbol so that no definition but the one locally in the
-   executable or DSO is used.  */
-#ifdef HAVE_DOT_HIDDEN
-asm (".hidden\tstat");
-asm (".hidden\t__stat");
-#endif
+weak_hidden_alias (__stat, stat)
diff --git a/io/stat64.c b/io/stat64.c
index cadf1e1f1d..14e036a700 100644
--- a/io/stat64.c
+++ b/io/stat64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 2001, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -46,13 +46,8 @@
 
 #undef stat64
 int
+attribute_hidden
 stat64 (const char *file, struct stat64 *buf)
 {
   return __xstat64 (_STAT_VER, file, buf);
 }
-
-/* Hide the symbol so that no definition but the one locally in the
-   executable or DSO is used.  */
-#ifdef HAVE_DOT_HIDDEN
-asm (".hidden\tstat64");
-#endif
diff --git a/libio/stdio.c b/libio/stdio.c
index 8dc24ed98f..b2baf65be3 100644
--- a/libio/stdio.c
+++ b/libio/stdio.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1993,1994,1996,1997,2000,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1993,1994,1996,1997,2000,2002,2006
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -40,14 +41,9 @@ _IO_FILE *stderr = (FILE *) &_IO_2_1_stderr_;
 #undef _IO_stderr
 #ifdef _LIBC
 # define AL(name) AL2 (name, _IO_##name)
-# if defined HAVE_VISIBILITY_ATTRIBUTE
-#  define AL2(name, al) \
+# define AL2(name, al) \
   extern __typeof (name) al __attribute__ ((alias (#name),                    \
                                             visibility ("hidden")))
-# else
-#  define AL2(name, al) \
-  extern __typeof (name) al __attribute__ ((alias (#name)))
-# endif
 AL(stdin);
 AL(stdout);
 AL(stderr);
diff --git a/nscd/Makefile b/nscd/Makefile
index 9c98018217..21657abeb7 100644
--- a/nscd/Makefile
+++ b/nscd/Makefile
@@ -119,9 +119,7 @@ CFLAGS-initgrcache.c += $(nscd-cflags)
 CFLAGS-gai.c += $(nscd-cflags)
 
 ifeq (yesyes,$(have-fpie)$(build-shared))
-ifeq (yes,$(have-z-relro))
 relro-LDFLAGS += -Wl,-z,now
-endif
 
 $(objpfx)nscd: $(addprefix $(objpfx),$(nscd-modules:=.o))
 	$(LINK.o) -pie -Wl,-O1 $(nscd-cflags) \
diff --git a/stdlib/Makefile b/stdlib/Makefile
index e632d3523b..a0ff427b7e 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -102,10 +102,6 @@ CFLAGS-strfmon.c = -D_IO_MTSAFE_IO
 CFLAGS-strfmon_l.c = -D_IO_MTSAFE_IO
 endif
 
-ifeq (yes,$(have-protected))
-CFLAGS-atexit.c = -DHAVE_DOT_HIDDEN
-endif
-
 CFLAGS-tst-bsearch.c = $(stack-align-test-flags)
 CFLAGS-tst-qsort.c = $(stack-align-test-flags)
 
diff --git a/stdlib/atexit.c b/stdlib/atexit.c
index 307662bdcd..0575dda03b 100644
--- a/stdlib/atexit.c
+++ b/stdlib/atexit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996, 1999, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1996, 1999, 2001, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -43,14 +43,9 @@ extern void *__dso_handle __attribute__ ((__weak__));
 
 /* Register FUNC to be executed by `exit'.  */
 int
+attribute_hidden
 atexit (void (*func) (void))
 {
   return __cxa_atexit ((void (*) (void *)) func, NULL,
 		       &__dso_handle == NULL ? NULL : __dso_handle);
 }
-
-/* Hide the symbol so that no definition but the one locally in the
-   executable or DSO is used.  */
-#ifdef HAVE_DOT_HIDDEN
-asm (".hidden\tatexit");
-#endif
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 98ba7d5b34..dda91bb806 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -490,17 +490,13 @@ struct rtld_global
 };
 # define __rtld_global_attribute__
 # ifdef IS_IN_rtld
-#  ifdef HAVE_VISIBILITY_ATTRIBUTE
-#   ifdef HAVE_SDATA_SECTION
-#    define __rtld_local_attribute__ \
+#  ifdef HAVE_SDATA_SECTION
+#   define __rtld_local_attribute__ \
 	    __attribute__ ((visibility ("hidden"), section (".sdata")))
-#    undef __rtld_global_attribute__
-#    define __rtld_global_attribute__ __attribute__ ((section (".sdata")))
-#   else
-#    define __rtld_local_attribute__ __attribute__ ((visibility ("hidden")))
-#   endif
+#   undef __rtld_global_attribute__
+#   define __rtld_global_attribute__ __attribute__ ((section (".sdata")))
 #  else
-#   define __rtld_local_attribute__
+#   define __rtld_local_attribute__ __attribute__ ((visibility ("hidden")))
 #  endif
 extern struct rtld_global _rtld_local __rtld_local_attribute__;
 #  undef __rtld_local_attribute__
@@ -662,11 +658,7 @@ struct rtld_global_ro
 };
 # define __rtld_global_attribute__
 # ifdef IS_IN_rtld
-#  ifdef HAVE_VISIBILITY_ATTRIBUTE
-#   define __rtld_local_attribute__ __attribute__ ((visibility ("hidden")))
-#  else
-#   define __rtld_local_attribute__
-#  endif
+#  define __rtld_local_attribute__ __attribute__ ((visibility ("hidden")))
 extern struct rtld_global_ro _rtld_local_ro
     attribute_relro __rtld_local_attribute__;
 extern struct rtld_global_ro _rtld_global_ro
diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h
index 6b8502c588..04296d2a9a 100644
--- a/sysdeps/i386/dl-machine.h
+++ b/sysdeps/i386/dl-machine.h
@@ -34,9 +34,7 @@ elf_machine_matches_host (const Elf32_Ehdr *ehdr)
 }
 
 
-#if defined PI_STATIC_AND_HIDDEN \
-    && defined HAVE_VISIBILITY_ATTRIBUTE && defined HAVE_HIDDEN \
-    && !defined HAVE_BROKEN_VISIBILITY_ATTRIBUTE
+#ifdef PI_STATIC_AND_HIDDEN
 
 /* Return the link-time address of _DYNAMIC.  Conveniently, this is the
    first element of the GOT, a special entry that is never relocated.  */
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index 4bd5394bec..113760d846 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -1,5 +1,5 @@
 /* Compare two memory blocks for differences in the first COUNT bytes.
-   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -44,13 +44,9 @@
      absolute address.  */						      \
   addl	(%ebx,INDEX,4), %ebx
 
-#ifdef HAVE_HIDDEN
 	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
 	.globl	__i686.get_pc_thunk.bx
 	.hidden	__i686.get_pc_thunk.bx
-#else
-        .text
-#endif
 	ALIGN (4)
 	.type	__i686.get_pc_thunk.bx,@function
 __i686.get_pc_thunk.bx:
diff --git a/sysdeps/i386/sysdep.h b/sysdeps/i386/sysdep.h
index 2739cb00b3..e03a8e926d 100644
--- a/sysdeps/i386/sysdep.h
+++ b/sysdeps/i386/sysdep.h
@@ -1,5 +1,6 @@
 /* Assembler macros for i386.
-   Copyright (C) 1991-93,95,96,98,2002,2003,2005 Free Software Foundation, Inc.
+   Copyright (C) 1991-93,95,96,98,2002,2003,2005,2006
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -132,15 +133,7 @@ lose: SYSCALL_PIC_SETUP							      \
     cfi_adjust_cfa_offset (-4);						      \
     addl $_GLOBAL_OFFSET_TABLE+[.-0b], %ebx;
 
-# ifndef HAVE_HIDDEN
-#  define SETUP_PIC_REG(reg) \
-  call 1f;								      \
-  .subsection 1;							      \
-1:movl (%esp), %e##reg;							      \
-  ret;									      \
-  .previous
-# else
-#  define SETUP_PIC_REG(reg) \
+# define SETUP_PIC_REG(reg) \
   .ifndef __i686.get_pc_thunk.reg;					      \
   .section .gnu.linkonce.t.__i686.get_pc_thunk.reg,"ax",@progbits;	      \
   .globl __i686.get_pc_thunk.reg;					      \
@@ -153,7 +146,6 @@ __i686.get_pc_thunk.reg:						      \
   .previous;								      \
   .endif;								      \
   call __i686.get_pc_thunk.reg
-# endif
 
 # define LOAD_PIC_REG(reg) \
   SETUP_PIC_REG(reg); addl $_GLOBAL_OFFSET_TABLE_, %e##reg
diff --git a/sysdeps/powerpc/powerpc32/sysdep.h b/sysdeps/powerpc/powerpc32/sysdep.h
index 8fc624ebd9..88cfe71e0b 100644
--- a/sysdeps/powerpc/powerpc32/sysdep.h
+++ b/sysdeps/powerpc/powerpc32/sysdep.h
@@ -96,7 +96,7 @@
 #endif
 
 #if defined SHARED && defined DO_VERSIONING && defined PIC \
-    && !defined HAVE_BROKEN_ALIAS_ATTRIBUTE && !defined NO_HIDDEN
+    && !defined NO_HIDDEN
 # undef HIDDEN_JUMPTARGET
 # define HIDDEN_JUMPTARGET(name) __GI_##name##@local
 #endif
diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure
index 2701e27298..a8a9cc4702 100644
--- a/sysdeps/unix/sysv/linux/configure
+++ b/sysdeps/unix/sysv/linux/configure
@@ -251,6 +251,33 @@ case "$prefix" in
   ;;
 esac
 
+# Under Linux the NPTL add-on should be available.
+case $add_ons in
+  # It is available.  Good.
+  *nptl*)
+    nptl_missing=
+    ;;
+  *)
+    nptl_missing=yes
+    ;;
+esac
+
+if test "$nptl_missing"; then
+  if test $enable_sanity = yes; then
+    echo "\
+*** On GNU/Linux systems it is normal to compile GNU libc with the
+*** \`nptl' add-on.  Without that, the library will be
+*** incompatible with normal GNU/Linux systems.
+*** If you really mean to not use this add-on, run configure again
+*** using the extra parameter \`--disable-sanity-checks'."
+    exit 1
+  else
+    echo "\
+*** WARNING: Are you sure you do not want to use the \`nptl'
+*** add-on?"
+  fi
+fi
+
 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
   if test $enable_sanity = yes; then
     echo "\
diff --git a/sysdeps/unix/sysv/linux/i386/sigaction.c b/sysdeps/unix/sysv/linux/i386/sigaction.c
index 299574dac4..b5c1b98573 100644
--- a/sysdeps/unix/sysv/linux/i386/sigaction.c
+++ b/sysdeps/unix/sysv/linux/i386/sigaction.c
@@ -1,5 +1,5 @@
 /* POSIX.1 `sigaction' call for Linux/i386.
-   Copyright (C) 1991,1995-2000,2002-2004,2005 Free Software Foundation, Inc.
+   Copyright (C) 1991,1995-2000,2002-2005,2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -46,18 +46,10 @@ int __libc_missing_rt_sigs;
 
 /* Using the hidden attribute here does not change the code but it
    helps to avoid warnings.  */
-#if defined HAVE_HIDDEN && defined HAVE_VISIBILITY_ATTRIBUTE \
-    && !defined HAVE_BROKEN_VISIBILITY_ATTRIBUTE
-# ifdef __NR_rt_sigaction
+#ifdef __NR_rt_sigaction
 extern void restore_rt (void) asm ("__restore_rt") attribute_hidden;
-# endif
-extern void restore (void) asm ("__restore") attribute_hidden;
-#else
-# ifdef __NR_rt_sigaction
-static void restore_rt (void) asm ("__restore_rt");
-# endif
-static void restore (void) asm ("__restore");
 #endif
+extern void restore (void) asm ("__restore") attribute_hidden;
 
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
diff --git a/sysdeps/unix/sysv/linux/x86_64/sigaction.c b/sysdeps/unix/sysv/linux/x86_64/sigaction.c
index d6f4558cef..b83e98a77e 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sigaction.c
+++ b/sysdeps/unix/sysv/linux/x86_64/sigaction.c
@@ -1,5 +1,5 @@
 /* POSIX.1 `sigaction' call for Linux/x86-64.
-   Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -38,12 +38,7 @@
 
 /* Using the hidden attribute here does not change the code but it
    helps to avoid warnings.  */
-#if defined HAVE_HIDDEN && defined HAVE_VISIBILITY_ATTRIBUTE \
-    && !defined HAVE_BROKEN_VISIBILITY_ATTRIBUTE
 extern void restore_rt (void) asm ("__restore_rt") attribute_hidden;
-#else
-static void restore_rt (void) asm ("__restore_rt");
-#endif
 
 
 /* If ACT is not NULL, change the action for SIG to *ACT.