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-507-g02d2d89


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  02d2d8927d2fd3815a9f3c5c767aa71a8a33408e (commit)
      from  0c609d19e33f0ee70dbe2fba04d2ea75d3dcbd14 (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=02d2d8927d2fd3815a9f3c5c767aa71a8a33408e

commit 02d2d8927d2fd3815a9f3c5c767aa71a8a33408e
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Oct 3 17:48:55 2017 -0700

    Revert x86: Allow undefined _DYNAMIC in static executable
    
    This code is used in non-PIE static executable and static PIE.  It checks
    if _DYNAMIC is undefined before using it to compute load address.  But
    not all targets can convert access _DYNAMIC via GOT, which needs dynamic
    relocation, to PC-relative at link-time.
    
    	* sysdeps/i386/dl-machine.h (elf_machine_load_address): Don't
    	allow undefined _DYNAMIC in PIE libc.a.
    	* sysdeps/x86_64/dl-machine.h (elf_machine_load_address):
    	Likewse.

diff --git a/ChangeLog b/ChangeLog
index 581a926..01517c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2017-10-03  H.J. Lu  <hongjiu.lu@intel.com>
 
+	* sysdeps/i386/dl-machine.h (elf_machine_load_address): Don't
+	allow undefined _DYNAMIC in PIE libc.a.
+	* sysdeps/x86_64/dl-machine.h (elf_machine_load_address):
+	Likewse.
+
+2017-10-03  H.J. Lu  <hongjiu.lu@intel.com>
+
 	* sysdeps/mips/dl-machine.h (elf_machine_load_address): Don't
 	check _DYNAMIC.
 
diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h
index 242c692..2e17eba 100644
--- a/sysdeps/i386/dl-machine.h
+++ b/sysdeps/i386/dl-machine.h
@@ -54,15 +54,8 @@ elf_machine_load_address (void)
   /* Compute the difference between the runtime address of _DYNAMIC as seen
      by a GOTOFF reference, and the link-time address found in the special
      unrelocated first GOT entry.  */
-#ifndef SHARED
-  extern Elf32_Dyn _DYNAMIC[] __attribute__((weak, visibility ("hidden")));
-  if (!_DYNAMIC)
-    return 0;
-#endif
-  /* The address of dynamic must be taken as non-weak to avoid dynamic
-     relocation.  */
-  extern Elf32_Dyn dynamic[] asm ("_DYNAMIC") attribute_hidden;
-  return (Elf32_Addr) &dynamic - elf_machine_dynamic ();
+  extern Elf32_Dyn bygotoff[] asm ("_DYNAMIC") attribute_hidden;
+  return (Elf32_Addr) &bygotoff - elf_machine_dynamic ();
 }
 
 /* Set up the loaded object described by L so its unrelocated PLT
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index a79e5ca..6a04cbc 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -55,15 +55,8 @@ elf_machine_load_address (void)
   /* Compute the difference between the runtime address of _DYNAMIC as seen
      by an IP-relative reference, and the link-time address found in the
      special unrelocated first GOT entry.  */
-#ifndef SHARED
-  extern ElfW(Dyn) _DYNAMIC[] __attribute__((weak, visibility ("hidden")));
-  if (!_DYNAMIC)
-    return 0;
-#endif
-  /* The address of dynamic must be taken as non-weak to avoid dynamic
-     relocation.  */
-  extern ElfW(Dyn) dynamic[] asm ("_DYNAMIC") attribute_hidden;
-  return (ElfW(Addr)) &dynamic - elf_machine_dynamic ();
+  extern ElfW(Dyn) _DYNAMIC[] attribute_hidden;
+  return (ElfW(Addr)) &_DYNAMIC - elf_machine_dynamic ();
 }
 
 /* Set up the loaded object described by L so its unrelocated PLT

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

Summary of changes:
 ChangeLog                   |    7 +++++++
 sysdeps/i386/dl-machine.h   |   11 ++---------
 sysdeps/x86_64/dl-machine.h |   11 ++---------
 3 files changed, 11 insertions(+), 18 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]