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

* 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.
This commit is contained in:
Ulrich Drepper
2006-10-28 06:44:41 +00:00
parent eb0a3d0cab
commit 78fbd00f39
35 changed files with 166 additions and 288 deletions

View File

@ -1,5 +1,40 @@
2006-10-27 Ulrich Drepper <drepper@redhat.com> 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. * Makerules: USE_TLS support is now default.
* tls.make.c: Likewise. * tls.make.c: Likewise.
* csu/Versions: Likewise. * csu/Versions: Likewise.

View File

@ -407,11 +407,9 @@ LDFLAGS.so += $(combreloc-LDFLAGS)
LDFLAGS-rtld += $(combreloc-LDFLAGS) LDFLAGS-rtld += $(combreloc-LDFLAGS)
endif endif
ifeq (yes,$(have-z-relro))
relro-LDFLAGS = -Wl,-z,relro relro-LDFLAGS = -Wl,-z,relro
LDFLAGS.so += $(relro-LDFLAGS) LDFLAGS.so += $(relro-LDFLAGS)
LDFLAGS-rtld += $(relro-LDFLAGS) LDFLAGS-rtld += $(relro-LDFLAGS)
endif
ifeq (yes,$(have-hash-style)) ifeq (yes,$(have-hash-style))
# For the time being we unconditionally use 'both'. At some time we # For the time being we unconditionally use 'both'. At some time we

View File

@ -120,23 +120,6 @@
/* Define if the linker supports the -z combreloc option. */ /* Define if the linker supports the -z combreloc option. */
#undef HAVE_Z_COMBRELOC #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. */ /* Define if _rtld_local structure should be forced into .sdata section. */
#undef HAVE_SDATA_SECTION #undef HAVE_SDATA_SECTION
@ -188,9 +171,6 @@
/* Defined if forced unwind support is available. */ /* Defined if forced unwind support is available. */
#undef HAVE_FORCED_UNWIND #undef HAVE_FORCED_UNWIND
/* Defined if the linker supports the -z relro option. */
#undef HAVE_Z_RELRO
/* Defined of libidn is available. */ /* Defined of libidn is available. */
#undef HAVE_LIBIDN #undef HAVE_LIBIDN

View File

@ -38,14 +38,9 @@ c++-sysincludes = @CXX_SYSINCLUDES@
all-warnings = @all_warnings@ all-warnings = @all_warnings@
elf = @elf@ 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-combreloc = @libc_cv_z_combreloc@
have-z-execstack = @libc_cv_z_execstack@ have-z-execstack = @libc_cv_z_execstack@
have-initfini = @libc_cv_have_initfini@ have-initfini = @libc_cv_have_initfini@
have-z-relro = @libc_cv_z_relro@
have-Bgroup = @libc_cv_Bgroup@ have-Bgroup = @libc_cv_Bgroup@
have-as-needed = @libc_cv_as_needed@ have-as-needed = @libc_cv_as_needed@
libgcc_s_suffix = @libc_cv_libgcc_s_suffix@ libgcc_s_suffix = @libc_cv_libgcc_s_suffix@

68
configure vendored
View File

@ -313,7 +313,7 @@ ac_includes_default="\
# include <unistd.h> # include <unistd.h>
#endif" #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='' ac_subst_files=''
# Initialize some variables set by options. # Initialize some variables set by options.
@ -5339,22 +5339,15 @@ EOF
(exit $ac_status); }; }; then (exit $ac_status); }; }; then
libc_cv_asm_protected_directive=yes libc_cv_asm_protected_directive=yes
else 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 fi
rm -f conftest* rm -f conftest*
fi fi
echo "$as_me:$LINENO: result: $libc_cv_asm_protected_directive" >&5 echo "$as_me:$LINENO: result: $libc_cv_asm_protected_directive" >&5
echo "${ECHO_T}$libc_cv_asm_protected_directive" >&6 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 if test $libc_cv_asm_protected_directive = yes; then
echo "$as_me:$LINENO: checking whether __attribute__((visibility())) is supported" >&5 echo "$as_me:$LINENO: checking whether __attribute__((visibility())) is supported" >&5
echo $ECHO_N "checking whether __attribute__((visibility())) is supported... $ECHO_C" >&6 echo $ECHO_N "checking whether __attribute__((visibility())) is supported... $ECHO_C" >&6
@ -5383,11 +5376,10 @@ EOF
fi fi
echo "$as_me:$LINENO: result: $libc_cv_visibility_attribute" >&5 echo "$as_me:$LINENO: result: $libc_cv_visibility_attribute" >&5
echo "${ECHO_T}$libc_cv_visibility_attribute" >&6 echo "${ECHO_T}$libc_cv_visibility_attribute" >&6
if test $libc_cv_visibility_attribute = yes; then if test $libc_cv_visibility_attribute != yes; then
cat >>confdefs.h <<\_ACEOF { { echo "$as_me:$LINENO: error: compiler support for visibility attribute is required" >&5
#define HAVE_VISIBILITY_ATTRIBUTE 1 echo "$as_me: error: compiler support for visibility attribute is required" >&2;}
_ACEOF { (exit 1); exit 1; }; }
fi fi
fi fi
@ -5419,10 +5411,9 @@ fi
echo "$as_me:$LINENO: result: $libc_cv_broken_visibility_attribute" >&5 echo "$as_me:$LINENO: result: $libc_cv_broken_visibility_attribute" >&5
echo "${ECHO_T}$libc_cv_broken_visibility_attribute" >&6 echo "${ECHO_T}$libc_cv_broken_visibility_attribute" >&6
if test $libc_cv_broken_visibility_attribute = yes; then if test $libc_cv_broken_visibility_attribute = yes; then
cat >>confdefs.h <<\_ACEOF { { echo "$as_me:$LINENO: error: working compiler support for visibility attribute is required" >&5
#define HAVE_BROKEN_VISIBILITY_ATTRIBUTE 1 echo "$as_me: error: working compiler support for visibility attribute is required" >&2;}
_ACEOF { (exit 1); exit 1; }; }
fi fi
fi fi
@ -5457,10 +5448,9 @@ fi
echo "$as_me:$LINENO: result: $libc_cv_broken_alias_attribute" >&5 echo "$as_me:$LINENO: result: $libc_cv_broken_alias_attribute" >&5
echo "${ECHO_T}$libc_cv_broken_alias_attribute" >&6 echo "${ECHO_T}$libc_cv_broken_alias_attribute" >&6
if test $libc_cv_broken_alias_attribute = yes; then if test $libc_cv_broken_alias_attribute = yes; then
cat >>confdefs.h <<\_ACEOF { { echo "$as_me:$LINENO: error: working alias attribute support required" >&5
#define HAVE_BROKEN_ALIAS_ATTRIBUTE 1 echo "$as_me: error: working alias attribute support required" >&2;}
_ACEOF { (exit 1); exit 1; }; }
fi fi
if test $libc_cv_visibility_attribute = yes; then if test $libc_cv_visibility_attribute = yes; then
@ -5572,14 +5562,15 @@ EOF
then then
libc_cv_z_nodelete=yes libc_cv_z_nodelete=yes
else 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 fi
rm -f conftest* rm -f conftest*
fi fi
echo "$as_me:$LINENO: result: $libc_cv_z_nodelete" >&5 echo "$as_me:$LINENO: result: $libc_cv_z_nodelete" >&5
echo "${ECHO_T}$libc_cv_z_nodelete" >&6 echo "${ECHO_T}$libc_cv_z_nodelete" >&6
echo "$as_me:$LINENO: checking for -z nodlopen option" >&5 echo "$as_me:$LINENO: checking for -z nodlopen option" >&5
echo $ECHO_N "checking for -z nodlopen option... $ECHO_C" >&6 echo $ECHO_N "checking for -z nodlopen option... $ECHO_C" >&6
if test "${libc_cv_z_nodlopen+set}" = set; then if test "${libc_cv_z_nodlopen+set}" = set; then
@ -5600,14 +5591,15 @@ EOF
then then
libc_cv_z_nodlopen=yes libc_cv_z_nodlopen=yes
else 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 fi
rm -f conftest* rm -f conftest*
fi fi
echo "$as_me:$LINENO: result: $libc_cv_z_nodlopen" >&5 echo "$as_me:$LINENO: result: $libc_cv_z_nodlopen" >&5
echo "${ECHO_T}$libc_cv_z_nodlopen" >&6 echo "${ECHO_T}$libc_cv_z_nodlopen" >&6
echo "$as_me:$LINENO: checking for -z initfirst option" >&5 echo "$as_me:$LINENO: checking for -z initfirst option" >&5
echo $ECHO_N "checking for -z initfirst option... $ECHO_C" >&6 echo $ECHO_N "checking for -z initfirst option... $ECHO_C" >&6
if test "${libc_cv_z_initfirst+set}" = set; then if test "${libc_cv_z_initfirst+set}" = set; then
@ -5628,14 +5620,15 @@ EOF
then then
libc_cv_z_initfirst=yes libc_cv_z_initfirst=yes
else 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 fi
rm -f conftest* rm -f conftest*
fi fi
echo "$as_me:$LINENO: result: $libc_cv_z_initfirst" >&5 echo "$as_me:$LINENO: result: $libc_cv_z_initfirst" >&5
echo "${ECHO_T}$libc_cv_z_initfirst" >&6 echo "${ECHO_T}$libc_cv_z_initfirst" >&6
echo "$as_me:$LINENO: checking for -z relro option" >&5 echo "$as_me:$LINENO: checking for -z relro option" >&5
echo $ECHO_N "checking for -z relro option... $ECHO_C" >&6 echo $ECHO_N "checking for -z relro option... $ECHO_C" >&6
if test "${libc_cv_z_relro+set}" = set; then if test "${libc_cv_z_relro+set}" = set; then
@ -5662,12 +5655,10 @@ else
fi fi
echo "$as_me:$LINENO: result: $libc_cv_z_relro" >&5 echo "$as_me:$LINENO: result: $libc_cv_z_relro" >&5
echo "${ECHO_T}$libc_cv_z_relro" >&6 echo "${ECHO_T}$libc_cv_z_relro" >&6
if test $libc_cv_z_relro != yes; then
if test $libc_cv_z_relro = yes; then { { echo "$as_me:$LINENO: error: linker with -z relro support required" >&5
cat >>confdefs.h <<\_ACEOF echo "$as_me: error: linker with -z relro support required" >&2;}
#define HAVE_Z_RELRO 1 { (exit 1); exit 1; }; }
_ACEOF
fi fi
echo "$as_me:$LINENO: checking for -Bgroup option" >&5 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,@INSTALL_INFO@,$INSTALL_INFO,;t t
s,@BISON@,$BISON,;t t s,@BISON@,$BISON,;t t
s,@VERSIONING@,$VERSIONING,;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_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_Bgroup@,$libc_cv_Bgroup,;t t
s,@libc_cv_libgcc_s_suffix@,$libc_cv_libgcc_s_suffix,;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 s,@libc_cv_as_needed@,$libc_cv_as_needed,;t t

View File

@ -1259,12 +1259,9 @@ EOF
if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
libc_cv_asm_protected_directive=yes libc_cv_asm_protected_directive=yes
else else
libc_cv_asm_protected_directive=no AC_MSG_ERROR(assembler support for symbol visibility is required)
fi fi
rm -f conftest*]) 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 if test $libc_cv_asm_protected_directive = yes; then
AC_CACHE_CHECK(whether __attribute__((visibility())) is supported, AC_CACHE_CHECK(whether __attribute__((visibility())) is supported,
@ -1283,8 +1280,8 @@ EOF
fi fi
rm -f conftest.[cs] rm -f conftest.[cs]
]) ])
if test $libc_cv_visibility_attribute = yes; then if test $libc_cv_visibility_attribute != yes; then
AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE) AC_MSG_ERROR(compiler support for visibility attribute is required)
fi fi
fi fi
@ -1307,7 +1304,7 @@ changequote([,])dnl
rm -f conftest.c conftest.s rm -f conftest.c conftest.s
]) ])
if test $libc_cv_broken_visibility_attribute = yes; then 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
fi fi
@ -1331,7 +1328,7 @@ EOF
rm -f conftest.c conftest.s rm -f conftest.c conftest.s
]) ])
if test $libc_cv_broken_alias_attribute = yes; then if test $libc_cv_broken_alias_attribute = yes; then
AC_DEFINE(HAVE_BROKEN_ALIAS_ATTRIBUTE) AC_MSG_ERROR(working alias attribute support required)
fi fi
if test $libc_cv_visibility_attribute = yes; then if test $libc_cv_visibility_attribute = yes; then
@ -1403,10 +1400,9 @@ EOF
then then
libc_cv_z_nodelete=yes libc_cv_z_nodelete=yes
else else
libc_cv_z_nodelete=no AC_MSG_ERROR(linker with -z nodelete support required)
fi fi
rm -f conftest*]) rm -f conftest*])
AC_SUBST(libc_cv_z_nodelete)
AC_CACHE_CHECK(for -z nodlopen option, AC_CACHE_CHECK(for -z nodlopen option,
libc_cv_z_nodlopen, [dnl libc_cv_z_nodlopen, [dnl
@ -1420,10 +1416,9 @@ EOF
then then
libc_cv_z_nodlopen=yes libc_cv_z_nodlopen=yes
else else
libc_cv_z_nodlopen=no AC_MSG_ERROR(linker with -z nodlopen support required)
fi fi
rm -f conftest*]) rm -f conftest*])
AC_SUBST(libc_cv_z_nodlopen)
AC_CACHE_CHECK(for -z initfirst option, AC_CACHE_CHECK(for -z initfirst option,
libc_cv_z_initfirst, [dnl libc_cv_z_initfirst, [dnl
@ -1437,10 +1432,9 @@ EOF
then then
libc_cv_z_initfirst=yes libc_cv_z_initfirst=yes
else else
libc_cv_z_initfirst=no AC_MSG_ERROR(linker with -z initfirst support required)
fi fi
rm -f conftest*]) rm -f conftest*])
AC_SUBST(libc_cv_z_initfirst)
AC_CACHE_CHECK(for -z relro option, AC_CACHE_CHECK(for -z relro option,
libc_cv_z_relro, [dnl libc_cv_z_relro, [dnl
@ -1452,9 +1446,8 @@ EOF
libc_cv_z_relro=yes libc_cv_z_relro=yes
fi fi
fi]) fi])
AC_SUBST(libc_cv_z_relro) if test $libc_cv_z_relro != yes; then
if test $libc_cv_z_relro = yes; then AC_MSG_ERROR(linker with -z relro support required)
AC_DEFINE(HAVE_Z_RELRO)
fi fi
AC_CACHE_CHECK(for -Bgroup option, AC_CACHE_CHECK(for -Bgroup option,

View File

@ -41,10 +41,7 @@ endif
ifeq (yes,$(build-shared)) ifeq (yes,$(build-shared))
tests = glrefmain failtest tst-dladdr default errmsg1 tstcxaatexit \ tests = glrefmain failtest tst-dladdr default errmsg1 tstcxaatexit \
bug-dlopen1 bug-dlsym1 tst-dlinfo bug-atexit1 bug-atexit2 \ bug-dlopen1 bug-dlsym1 tst-dlinfo bug-atexit1 bug-atexit2 \
bug-atexit3 bug-atexit3 tstatexit
ifeq (yes,$(have-protected))
tests += tstatexit
endif
endif endif
modules-names = glreflib1 glreflib2 failtestmod defaultmod1 defaultmod2 \ modules-names = glreflib1 glreflib2 failtestmod defaultmod1 defaultmod2 \
errmsg1mod modatexit modcxaatexit \ errmsg1mod modatexit modcxaatexit \

View File

@ -159,8 +159,8 @@ endif
ifeq (yes,$(build-shared)) ifeq (yes,$(build-shared))
tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
constload1 order $(tests-vis-$(have-protected)) noload filter unload \ constload1 order $(tests-vis-$(have-protected)) noload filter unload \
reldep reldep2 reldep3 reldep4 $(tests-nodelete-$(have-z-nodelete)) \ reldep reldep2 reldep3 reldep4 nodelete nodelete2 \
$(tests-nodlopen-$(have-z-nodlopen)) neededtest neededtest2 \ nodlopen nodlopen2 neededtest neededtest2 \
neededtest3 neededtest4 unload2 lateglobal initfirst global \ neededtest3 neededtest4 unload2 lateglobal initfirst global \
restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \ restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \
circleload1 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 \ 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 # reldep9
test-srcs = tst-pathopt test-srcs = tst-pathopt
tests-vis-yes = vismain 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 tests-execstack-yes = tst-execstack tst-execstack-needed tst-execstack-prog
endif endif
ifeq (yesyes,$(have-fpie)$(build-shared)) ifeq (yesyes,$(have-fpie)$(build-shared))
@ -186,8 +184,9 @@ tests: $(objpfx)tst-leaks1-mem
modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
testobj1_1 failobj constload2 constload3 unloadmod \ testobj1_1 failobj constload2 constload3 unloadmod \
dep1 dep2 dep3 dep4 $(modules-vis-$(have-protected)) \ dep1 dep2 dep3 dep4 $(modules-vis-$(have-protected)) \
$(modules-nodelete-$(have-z-nodelete)) \ nodelmod1 nodelmod2 nodelmod3 nodelmod4 \
$(modules-nodlopen-$(have-z-nodlopen)) filtmod1 filtmod2 \ nodel2mod1 nodel2mod2 nodel2mod3 \
nodlopenmod nodlopenmod2 filtmod1 filtmod2 \
reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \ reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \
reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \ reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \
neededobj1 neededobj2 neededobj3 neededobj4 \ neededobj1 neededobj2 neededobj3 neededobj4 \
@ -221,9 +220,6 @@ ifeq (yesyes,$(have-fpie)$(build-shared))
modules-names += tst-piemod1 modules-names += tst-piemod1
endif endif
modules-vis-yes = vismod1 vismod2 vismod3 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 modules-execstack-yes = tst-execstack-mod
extra-test-objs += $(addsuffix .os,$(strip $(modules-names))) extra-test-objs += $(addsuffix .os,$(strip $(modules-names)))
# We need this variable to be sure the test modules get the right CPPFLAGS. # We need this variable to be sure the test modules get the right CPPFLAGS.

View File

@ -1392,7 +1392,7 @@ cannot allocate TLS data structures for initial thread");
requires that it be executable. We must change the requires that it be executable. We must change the
protection of the variable which contains the flags used in protection of the variable which contains the flags used in
the mprotect calls. */ the mprotect calls. */
#if defined HAVE_Z_RELRO && defined SHARED #ifdef SHARED
if ((mode & (__RTLD_DLOPEN | __RTLD_AUDIT)) == __RTLD_DLOPEN) if ((mode & (__RTLD_DLOPEN | __RTLD_AUDIT)) == __RTLD_DLOPEN)
{ {
const uintptr_t p = (uintptr_t) &__stack_prot & -GLRO(dl_pagesize); 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. */ must not be freed using the general free() in libc. */
if (sps->malloced) if (sps->malloced)
free (sps->dirs); free (sps->dirs);
#ifdef HAVE_Z_RELRO
/* rtld_search_dirs is attribute_relro, therefore avoid writing /* rtld_search_dirs is attribute_relro, therefore avoid writing
into it. */ into it. */
if (sps != &rtld_search_dirs) if (sps != &rtld_search_dirs)
#endif
sps->dirs = (void *) -1; sps->dirs = (void *) -1;
} }

View File

@ -207,8 +207,7 @@ DL_SYSINFO_IMPLEMENTATION
is fine, too. The latter is important here. We can avoid setting 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 up a temporary link map for ld.so if we can mark _rtld_global as
hidden. */ hidden. */
#if defined PI_STATIC_AND_HIDDEN && defined HAVE_HIDDEN \ #ifdef PI_STATIC_AND_HIDDEN
&& defined HAVE_VISIBILITY_ATTRIBUTE
# define DONT_USE_BOOTSTRAP_MAP 1 # define DONT_USE_BOOTSTRAP_MAP 1
#endif #endif

View File

@ -114,6 +114,13 @@
# define _weak_alias(name, aliasname) \ # define _weak_alias(name, aliasname) \
extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))); 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). */ /* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */
# define weak_extern(symbol) _weak_extern (weak symbol) # define weak_extern(symbol) _weak_extern (weak symbol)
# define _weak_extern(expr) _Pragma (#expr) # define _weak_extern(expr) _Pragma (#expr)
@ -121,6 +128,7 @@
# else # else
# define weak_alias(name, aliasname) strong_alias(name, aliasname) # define weak_alias(name, aliasname) strong_alias(name, aliasname)
# define weak_hidden_alias(name, aliasname) strong_alias(name, aliasname)
# define weak_extern(symbol) /* Nothing. */ # define weak_extern(symbol) /* Nothing. */
# endif # endif
@ -431,8 +439,7 @@ for linking")
strong_alias(real, name) strong_alias(real, name)
#endif #endif
#if defined HAVE_VISIBILITY_ATTRIBUTE \ #if defined SHARED || defined LIBC_NONSHARED
&& (defined SHARED || defined LIBC_NONSHARED)
# define attribute_hidden __attribute__ ((visibility ("hidden"))) # define attribute_hidden __attribute__ ((visibility ("hidden")))
#else #else
# define attribute_hidden # define attribute_hidden
@ -444,11 +451,7 @@ for linking")
# define attribute_tls_model_ie # define attribute_tls_model_ie
#endif #endif
#ifdef HAVE_Z_RELRO #define attribute_relro __attribute__ ((section (".data.rel.ro")))
# define attribute_relro __attribute__ ((section (".data.rel.ro")))
#else
# define attribute_relro
#endif
/* Handling on non-exported internal names. We have to do this only /* Handling on non-exported internal names. We have to do this only
for shared code. */ for shared code. */
@ -457,14 +460,9 @@ for linking")
# define INTDEF(name) strong_alias (name, name##_internal) # define INTDEF(name) strong_alias (name, name##_internal)
# define INTVARDEF(name) \ # define INTVARDEF(name) \
_INTVARDEF (name, name##_internal) _INTVARDEF (name, name##_internal)
# if defined HAVE_VISIBILITY_ATTRIBUTE # define _INTVARDEF(name, aliasname) \
# define _INTVARDEF(name, aliasname) \
extern __typeof (name) aliasname __attribute__ ((alias (#name), \ extern __typeof (name) aliasname __attribute__ ((alias (#name), \
visibility ("hidden"))); 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 INTDEF2(name, newname) strong_alias (name, newname##_internal)
# define INTVARDEF2(name, newname) _INTVARDEF (name, newname##_internal) # define INTVARDEF2(name, newname) _INTVARDEF (name, newname##_internal)
#else #else
@ -549,16 +547,10 @@ for linking")
versioned_symbol (libc, __real_foo, foo, GLIBC_2_1); versioned_symbol (libc, __real_foo, foo, GLIBC_2_1);
libc_hidden_ver (__real_foo, foo) */ libc_hidden_ver (__real_foo, foo) */
#if defined SHARED && defined DO_VERSIONING \ #if defined SHARED && defined DO_VERSIONING && !defined NO_HIDDEN
&& !defined HAVE_BROKEN_ALIAS_ATTRIBUTE && !defined NO_HIDDEN
# ifndef __ASSEMBLER__ # ifndef __ASSEMBLER__
# if !defined HAVE_VISIBILITY_ATTRIBUTE \ # define __hidden_proto_hiddenattr(attrs...) \
|| defined HAVE_BROKEN_VISIBILITY_ATTRIBUTE
# define __hidden_proto_hiddenattr(attrs...)
# else
# define __hidden_proto_hiddenattr(attrs...) \
__attribute__ ((visibility ("hidden"), ##attrs)) __attribute__ ((visibility ("hidden"), ##attrs))
# endif
# define hidden_proto(name, attrs...) \ # define hidden_proto(name, attrs...) \
__hidden_proto (name, __GI_##name, ##attrs) __hidden_proto (name, __GI_##name, ##attrs)
# define __hidden_proto(name, internal, attrs...) \ # define __hidden_proto(name, internal, attrs...) \

View File

@ -131,7 +131,6 @@ libc_hidden_proto (__vsnprintf_chk)
libc_hidden_proto (__vfprintf_chk) libc_hidden_proto (__vfprintf_chk)
# if !defined NOT_IN_libc && defined SHARED && defined DO_VERSIONING \ # if !defined NOT_IN_libc && defined SHARED && defined DO_VERSIONING \
&& defined HAVE_VISIBILITY_ATTRIBUTE && !defined HAVE_BROKEN_ALIAS_ATTRIBUTE\
&& !defined NO_HIDDEN && !defined NO_HIDDEN
/* Special gcc builtins. */ /* Special gcc builtins. */
extern size_t __builtin_fwrite (const void *, size_t, size_t, void *) extern size_t __builtin_fwrite (const void *, size_t, size_t, void *)

View File

@ -90,19 +90,6 @@ CFLAGS-posix_fallocate64.c = -fexceptions
CFLAGS-test-stat.c = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE CFLAGS-test-stat.c = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS-test-lfs.c = -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 test-stat2-ARGS = Makefile . $(objpfx)test-stat2
tst-statvfs-ARGS = $(objpfx)tst-statvfs tst-statvfs.c /tmp tst-statvfs-ARGS = $(objpfx)tst-statvfs tst-statvfs.c /tmp

View File

@ -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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -47,16 +47,10 @@
#undef fstat #undef fstat
#undef __fstat #undef __fstat
int int
attribute_hidden
__fstat (int fd, struct stat *buf) __fstat (int fd, struct stat *buf)
{ {
return __fxstat (_STAT_VER, fd, buf); return __fxstat (_STAT_VER, fd, buf);
} }
weak_alias (__fstat, fstat) weak_hidden_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

View File

@ -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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -46,13 +46,8 @@
#undef fstat64 #undef fstat64
int int
attribute_hidden
fstat64 (int fd, struct stat64 *buf) fstat64 (int fd, struct stat64 *buf)
{ {
return __fxstat64 (_STAT_VER, fd, 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

View File

@ -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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -46,13 +46,8 @@
#undef fstatat #undef fstatat
int int
attribute_hidden
fstatat (int fd, const char *file, struct stat *buf, int flag) fstatat (int fd, const char *file, struct stat *buf, int flag)
{ {
return __fxstatat (_STAT_VER, fd, file, buf, 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

View File

@ -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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -46,13 +46,8 @@
#undef fstatat64 #undef fstatat64
int int
attribute_hidden
fstatat64 (int fd, const char *file, struct stat64 *buf, int flag) fstatat64 (int fd, const char *file, struct stat64 *buf, int flag)
{ {
return __fxstatat64 (_STAT_VER, fd, file, buf, 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

View File

@ -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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -47,16 +47,10 @@
#undef lstat #undef lstat
#undef __lstat #undef __lstat
int int
attribute_hidden
__lstat (const char *file, struct stat *buf) __lstat (const char *file, struct stat *buf)
{ {
return __lxstat (_STAT_VER, file, buf); return __lxstat (_STAT_VER, file, buf);
} }
weak_alias (__lstat, lstat) weak_hidden_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

View File

@ -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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -46,13 +46,8 @@
#undef lstat64 #undef lstat64
int int
attribute_hidden
lstat64 (const char *file, struct stat64 *buf) lstat64 (const char *file, struct stat64 *buf)
{ {
return __lxstat64 (_STAT_VER, file, 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

View File

@ -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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -47,16 +47,10 @@
all callers. */ all callers. */
int int
attribute_hidden
__mknod (const char *path, mode_t mode, dev_t dev) __mknod (const char *path, mode_t mode, dev_t dev)
{ {
return __xmknod (_MKNOD_VER, path, mode, &dev); return __xmknod (_MKNOD_VER, path, mode, &dev);
} }
weak_alias (__mknod, mknod) weak_hidden_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

View File

@ -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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -47,14 +47,8 @@
all callers. */ all callers. */
int int
attribute_hidden
mknodat (int fd, const char *path, mode_t mode, dev_t dev) mknodat (int fd, const char *path, mode_t mode, dev_t dev)
{ {
return __xmknodat (_MKNOD_VER, fd, path, mode, &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

View File

@ -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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -46,16 +46,10 @@
#undef stat #undef stat
int int
attribute_hidden
__stat (const char *file, struct stat *buf) __stat (const char *file, struct stat *buf)
{ {
return __xstat (_STAT_VER, file, buf); return __xstat (_STAT_VER, file, buf);
} }
weak_alias (__stat, stat) weak_hidden_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

View File

@ -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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -46,13 +46,8 @@
#undef stat64 #undef stat64
int int
attribute_hidden
stat64 (const char *file, struct stat64 *buf) stat64 (const char *file, struct stat64 *buf)
{ {
return __xstat64 (_STAT_VER, file, 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

View File

@ -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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or 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 #undef _IO_stderr
#ifdef _LIBC #ifdef _LIBC
# define AL(name) AL2 (name, _IO_##name) # 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), \ extern __typeof (name) al __attribute__ ((alias (#name), \
visibility ("hidden"))) visibility ("hidden")))
# else
# define AL2(name, al) \
extern __typeof (name) al __attribute__ ((alias (#name)))
# endif
AL(stdin); AL(stdin);
AL(stdout); AL(stdout);
AL(stderr); AL(stderr);

View File

@ -119,9 +119,7 @@ CFLAGS-initgrcache.c += $(nscd-cflags)
CFLAGS-gai.c += $(nscd-cflags) CFLAGS-gai.c += $(nscd-cflags)
ifeq (yesyes,$(have-fpie)$(build-shared)) ifeq (yesyes,$(have-fpie)$(build-shared))
ifeq (yes,$(have-z-relro))
relro-LDFLAGS += -Wl,-z,now relro-LDFLAGS += -Wl,-z,now
endif
$(objpfx)nscd: $(addprefix $(objpfx),$(nscd-modules:=.o)) $(objpfx)nscd: $(addprefix $(objpfx),$(nscd-modules:=.o))
$(LINK.o) -pie -Wl,-O1 $(nscd-cflags) \ $(LINK.o) -pie -Wl,-O1 $(nscd-cflags) \

View File

@ -102,10 +102,6 @@ CFLAGS-strfmon.c = -D_IO_MTSAFE_IO
CFLAGS-strfmon_l.c = -D_IO_MTSAFE_IO CFLAGS-strfmon_l.c = -D_IO_MTSAFE_IO
endif endif
ifeq (yes,$(have-protected))
CFLAGS-atexit.c = -DHAVE_DOT_HIDDEN
endif
CFLAGS-tst-bsearch.c = $(stack-align-test-flags) CFLAGS-tst-bsearch.c = $(stack-align-test-flags)
CFLAGS-tst-qsort.c = $(stack-align-test-flags) CFLAGS-tst-qsort.c = $(stack-align-test-flags)

View File

@ -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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or 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'. */ /* Register FUNC to be executed by `exit'. */
int int
attribute_hidden
atexit (void (*func) (void)) atexit (void (*func) (void))
{ {
return __cxa_atexit ((void (*) (void *)) func, NULL, return __cxa_atexit ((void (*) (void *)) func, NULL,
&__dso_handle == NULL ? NULL : __dso_handle); &__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

View File

@ -490,17 +490,13 @@ struct rtld_global
}; };
# define __rtld_global_attribute__ # define __rtld_global_attribute__
# ifdef IS_IN_rtld # ifdef IS_IN_rtld
# ifdef HAVE_VISIBILITY_ATTRIBUTE # ifdef HAVE_SDATA_SECTION
# ifdef HAVE_SDATA_SECTION # define __rtld_local_attribute__ \
# define __rtld_local_attribute__ \
__attribute__ ((visibility ("hidden"), section (".sdata"))) __attribute__ ((visibility ("hidden"), section (".sdata")))
# undef __rtld_global_attribute__ # undef __rtld_global_attribute__
# define __rtld_global_attribute__ __attribute__ ((section (".sdata"))) # define __rtld_global_attribute__ __attribute__ ((section (".sdata")))
# else
# define __rtld_local_attribute__ __attribute__ ((visibility ("hidden")))
# endif
# else # else
# define __rtld_local_attribute__ # define __rtld_local_attribute__ __attribute__ ((visibility ("hidden")))
# endif # endif
extern struct rtld_global _rtld_local __rtld_local_attribute__; extern struct rtld_global _rtld_local __rtld_local_attribute__;
# undef __rtld_local_attribute__ # undef __rtld_local_attribute__
@ -662,11 +658,7 @@ struct rtld_global_ro
}; };
# define __rtld_global_attribute__ # define __rtld_global_attribute__
# ifdef IS_IN_rtld # ifdef IS_IN_rtld
# ifdef HAVE_VISIBILITY_ATTRIBUTE # define __rtld_local_attribute__ __attribute__ ((visibility ("hidden")))
# define __rtld_local_attribute__ __attribute__ ((visibility ("hidden")))
# else
# define __rtld_local_attribute__
# endif
extern struct rtld_global_ro _rtld_local_ro extern struct rtld_global_ro _rtld_local_ro
attribute_relro __rtld_local_attribute__; attribute_relro __rtld_local_attribute__;
extern struct rtld_global_ro _rtld_global_ro extern struct rtld_global_ro _rtld_global_ro

View File

@ -34,9 +34,7 @@ elf_machine_matches_host (const Elf32_Ehdr *ehdr)
} }
#if defined PI_STATIC_AND_HIDDEN \ #ifdef PI_STATIC_AND_HIDDEN
&& defined HAVE_VISIBILITY_ATTRIBUTE && defined HAVE_HIDDEN \
&& !defined HAVE_BROKEN_VISIBILITY_ATTRIBUTE
/* Return the link-time address of _DYNAMIC. Conveniently, this is the /* Return the link-time address of _DYNAMIC. Conveniently, this is the
first element of the GOT, a special entry that is never relocated. */ first element of the GOT, a special entry that is never relocated. */

View File

@ -1,5 +1,5 @@
/* Compare two memory blocks for differences in the first COUNT bytes. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -44,13 +44,9 @@
absolute address. */ \ absolute address. */ \
addl (%ebx,INDEX,4), %ebx addl (%ebx,INDEX,4), %ebx
#ifdef HAVE_HIDDEN
.section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
.globl __i686.get_pc_thunk.bx .globl __i686.get_pc_thunk.bx
.hidden __i686.get_pc_thunk.bx .hidden __i686.get_pc_thunk.bx
#else
.text
#endif
ALIGN (4) ALIGN (4)
.type __i686.get_pc_thunk.bx,@function .type __i686.get_pc_thunk.bx,@function
__i686.get_pc_thunk.bx: __i686.get_pc_thunk.bx:

View File

@ -1,5 +1,6 @@
/* Assembler macros for i386. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or 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); \ cfi_adjust_cfa_offset (-4); \
addl $_GLOBAL_OFFSET_TABLE+[.-0b], %ebx; addl $_GLOBAL_OFFSET_TABLE+[.-0b], %ebx;
# ifndef HAVE_HIDDEN # define SETUP_PIC_REG(reg) \
# define SETUP_PIC_REG(reg) \
call 1f; \
.subsection 1; \
1:movl (%esp), %e##reg; \
ret; \
.previous
# else
# define SETUP_PIC_REG(reg) \
.ifndef __i686.get_pc_thunk.reg; \ .ifndef __i686.get_pc_thunk.reg; \
.section .gnu.linkonce.t.__i686.get_pc_thunk.reg,"ax",@progbits; \ .section .gnu.linkonce.t.__i686.get_pc_thunk.reg,"ax",@progbits; \
.globl __i686.get_pc_thunk.reg; \ .globl __i686.get_pc_thunk.reg; \
@ -153,7 +146,6 @@ __i686.get_pc_thunk.reg: \
.previous; \ .previous; \
.endif; \ .endif; \
call __i686.get_pc_thunk.reg call __i686.get_pc_thunk.reg
# endif
# define LOAD_PIC_REG(reg) \ # define LOAD_PIC_REG(reg) \
SETUP_PIC_REG(reg); addl $_GLOBAL_OFFSET_TABLE_, %e##reg SETUP_PIC_REG(reg); addl $_GLOBAL_OFFSET_TABLE_, %e##reg

View File

@ -96,7 +96,7 @@
#endif #endif
#if defined SHARED && defined DO_VERSIONING && defined PIC \ #if defined SHARED && defined DO_VERSIONING && defined PIC \
&& !defined HAVE_BROKEN_ALIAS_ATTRIBUTE && !defined NO_HIDDEN && !defined NO_HIDDEN
# undef HIDDEN_JUMPTARGET # undef HIDDEN_JUMPTARGET
# define HIDDEN_JUMPTARGET(name) __GI_##name##@local # define HIDDEN_JUMPTARGET(name) __GI_##name##@local
#endif #endif

View File

@ -251,6 +251,33 @@ case "$prefix" in
;; ;;
esac 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 "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
if test $enable_sanity = yes; then if test $enable_sanity = yes; then
echo "\ echo "\

View File

@ -1,5 +1,5 @@
/* POSIX.1 `sigaction' call for Linux/i386. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or 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 /* Using the hidden attribute here does not change the code but it
helps to avoid warnings. */ helps to avoid warnings. */
#if defined HAVE_HIDDEN && defined HAVE_VISIBILITY_ATTRIBUTE \ #ifdef __NR_rt_sigaction
&& !defined HAVE_BROKEN_VISIBILITY_ATTRIBUTE
# ifdef __NR_rt_sigaction
extern void restore_rt (void) asm ("__restore_rt") attribute_hidden; 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 #endif
extern void restore (void) asm ("__restore") attribute_hidden;
/* If ACT is not NULL, change the action for SIG to *ACT. /* If ACT is not NULL, change the action for SIG to *ACT.

View File

@ -1,5 +1,5 @@
/* POSIX.1 `sigaction' call for Linux/x86-64. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or 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 /* Using the hidden attribute here does not change the code but it
helps to avoid warnings. */ 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; 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. /* If ACT is not NULL, change the action for SIG to *ACT.