This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.26-521-gee41788


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  ee417882e07277b2a36e7e61e6ef7edd96415b3f (commit)
       via  a67029ff12319300458a502be1d12aa2065c48da (commit)
      from  5dba84b3246961ea3032ce48ac72c1ac9364cf2b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ee417882e07277b2a36e7e61e6ef7edd96415b3f

commit ee417882e07277b2a36e7e61e6ef7edd96415b3f
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Oct 4 17:18:23 2017 -0700

    Don't use hidden visibility in libc.a with PIE on i386
    
    On i386, when multi-arch is enabled, all external functions must be
    called via PIC PLT in PIE, which requires setting up EBX register,
    since they may be IFUNC functions.
    
    	* config.h.in (NO_HIDDEN_EXTERN_FUNC_IN_PIE): New.
    	* include/libc-symbols.h (__hidden_proto_hiddenattr): Add check
    	for PIC and NO_HIDDEN_EXTERN_FUNC_IN_PIE.
    	* sysdeps/i386/configure.ac (NO_HIDDEN_EXTERN_FUNC_IN_PIE): New
    	AC_DEFINE if multi-arch is enabled.
    	* sysdeps/i386/configure: Regenerated.

diff --git a/ChangeLog b/ChangeLog
index 191dd5a..bb09add 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2017-10-04  H.J. Lu  <hongjiu.lu@intel.com>
 
+	* config.h.in (NO_HIDDEN_EXTERN_FUNC_IN_PIE): New.
+	* include/libc-symbols.h (__hidden_proto_hiddenattr): Add check
+	for PIC and NO_HIDDEN_EXTERN_FUNC_IN_PIE.
+	* sysdeps/i386/configure.ac (NO_HIDDEN_EXTERN_FUNC_IN_PIE): New
+	AC_DEFINE if multi-arch is enabled.
+	* sysdeps/i386/configure: Regenerated.
+
+2017-10-04  H.J. Lu  <hongjiu.lu@intel.com>
+
 	* Makeconfig (+link-static-before-libc): Use
 	$(DEFAULT-LDFLAGS-$(@F)).
 	* elf/Makefile (CRT-tst-tls1-static-non-pie): New.
diff --git a/config.h.in b/config.h.in
index 0d38476..c140ff3 100644
--- a/config.h.in
+++ b/config.h.in
@@ -86,6 +86,10 @@
 #undef	PI_STATIC_AND_HIDDEN
 
 /* Define this to disable the 'hidden_proto' et al macros in
+   include/libc-symbols.h that avoid PLT slots in PIE.  */
+#undef  NO_HIDDEN_EXTERN_FUNC_IN_PIE
+
+/* Define this to disable the 'hidden_proto' et al macros in
    include/libc-symbols.h that avoid PLT slots in the shared objects.  */
 #undef	NO_HIDDEN
 
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index e0d4dc3..8726262 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -507,6 +507,7 @@ for linking")
 #else
 # ifndef __ASSEMBLER__
 #  if !defined SHARED && IS_IN (libc) && !defined LIBC_NONSHARED \
+      && (!defined PIC || !defined NO_HIDDEN_EXTERN_FUNC_IN_PIE) \
       && !defined NO_HIDDEN
 #   define __hidden_proto_hiddenattr(attrs...) \
   __attribute__ ((visibility ("hidden"), ##attrs))
diff --git a/sysdeps/i386/configure b/sysdeps/i386/configure
index 4d6685f..4cf968d 100644
--- a/sysdeps/i386/configure
+++ b/sysdeps/i386/configure
@@ -26,7 +26,7 @@ libc_compiler_builtin_inlined=no
 cat > conftest.c <<EOF
 int _start (void) { int a, b, c; __sync_val_compare_and_swap (&a, b, c); return 0; }
 EOF
-if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
 		     -O0 -nostdlib -nostartfiles
 		     -S conftest.c -o - | fgrep "__sync_val_compare_and_swap"
 		     1>&5'
@@ -79,3 +79,8 @@ fi
 
 $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
 
+
+if test x"$multi_arch" != xno; then
+  $as_echo "#define NO_HIDDEN_EXTERN_FUNC_IN_PIE 1" >>confdefs.h
+
+fi
diff --git a/sysdeps/i386/configure.ac b/sysdeps/i386/configure.ac
index f7766ad..b598b12 100644
--- a/sysdeps/i386/configure.ac
+++ b/sysdeps/i386/configure.ac
@@ -48,3 +48,9 @@ fi
 dnl It is always possible to access static and hidden symbols in an
 dnl position independent way.
 AC_DEFINE(PI_STATIC_AND_HIDDEN)
+
+dnl When multi-arch is enabled, all external functions must be called
+dnl via PIC PLT in PIE, which requires setting up EBX register.
+if test x"$multi_arch" != xno; then
+  AC_DEFINE(NO_HIDDEN_EXTERN_FUNC_IN_PIE)
+fi

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a67029ff12319300458a502be1d12aa2065c48da

commit a67029ff12319300458a502be1d12aa2065c48da
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Oct 4 17:15:50 2017 -0700

    Use $(DEFAULT-LDFLAGS-$(@F)) in +link-static-before-libc
    
    Use $(LDFLAGS-$(@F)) with tst-tls1-static-non-pie may not be sufficient
    when static PIE is built by default.  Use $(DEFAULT-LDFLAGS-$(@F)) in
    +link-static-before-libc to make sure that tst-tls1-static-non-pie is
    always built as non-PIE static executable and make sure that crt1.o is
    used with tst-tls1-static-non-pie.
    
    	* Makeconfig (+link-static-before-libc): Use
    	$(DEFAULT-LDFLAGS-$(@F)).
    	* elf/Makefile (CRT-tst-tls1-static-non-pie): New.
    	(LDFLAGS-tst-tls1-static-non-pie): Renamed to ...
    	(DEFAULT-LDFLAGS-tst-tls1-static-non-pie): This.

diff --git a/ChangeLog b/ChangeLog
index 6f1b3ce..191dd5a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2017-10-04  H.J. Lu  <hongjiu.lu@intel.com>
 
+	* Makeconfig (+link-static-before-libc): Use
+	$(DEFAULT-LDFLAGS-$(@F)).
+	* elf/Makefile (CRT-tst-tls1-static-non-pie): New.
+	(LDFLAGS-tst-tls1-static-non-pie): Renamed to ...
+	(DEFAULT-LDFLAGS-tst-tls1-static-non-pie): This.
+
+2017-10-04  H.J. Lu  <hongjiu.lu@intel.com>
+
 	* elf/Makefile (tests): Add tst-main1.
 	(modules-names): Add tst-main1mod.
 	($(objpfx)tst-main1): New.
diff --git a/Makeconfig b/Makeconfig
index b51904b..0ceff92 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -435,6 +435,7 @@ endif
 # Command for statically linking programs with the C library.
 ifndef +link-static
 +link-static-before-libc = $(CC) -nostdlib -nostartfiles -static -o $@ \
+	      $(DEFAULT-LDFLAGS-$(@F)) \
 	      $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F))  \
 	      $(addprefix $(csu-objpfx),$(static-start-installed-name)) \
 	      $(+preinit) $(+prectorT) \
diff --git a/elf/Makefile b/elf/Makefile
index 0dcbf2f..a31fb72 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -152,7 +152,8 @@ tests-static-internal := tst-tls1-static tst-tls2-static \
 	       tst-ptrguard1-static tst-stackguard1-static \
 	       tst-tls1-static-non-pie
 
-LDFLAGS-tst-tls1-static-non-pie = $(no-pie-ldflag)
+CRT-tst-tls1-static-non-pie := $(csu-objpfx)crt1.o
+DEFAULT-LDFLAGS-tst-tls1-static-non-pie = $(no-pie-ldflag)
 
 tests := tst-tls9 tst-leaks1 \
 	tst-array1 tst-array2 tst-array3 tst-array4 tst-array5 \

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                 |   17 +++++++++++++++++
 Makeconfig                |    1 +
 config.h.in               |    4 ++++
 elf/Makefile              |    3 ++-
 include/libc-symbols.h    |    1 +
 sysdeps/i386/configure    |    7 ++++++-
 sysdeps/i386/configure.ac |    6 ++++++
 7 files changed, 37 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]