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-426-g8172aad


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  8172aad937f52fe4ae891a206492150815791f2a (commit)
      from  54464e749d91401ccf20a5dc1c7af86b752c9e0c (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=8172aad937f52fe4ae891a206492150815791f2a

commit 8172aad937f52fe4ae891a206492150815791f2a
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Sep 29 16:23:18 2017 -0700

    arm: Update elf_machine_load_address for static PIE
    
    When --enable-static-pie is used to configure glibc, we need to use
    _dl_relocate_static_pie to compute load address in static PIE.
    
    	* sysdeps/arm/dl-machine.h (elf_machine_load_address): Use
    	_dl_relocate_static_pie instead of _dl_start to compute load
    	address in static PIE.  Return 0 if _DYNAMIC is undefined for
    	static executable.

diff --git a/ChangeLog b/ChangeLog
index efd567c..b6dbff0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2017-09-29  H.J. Lu  <hongjiu.lu@intel.com>
 
+	* sysdeps/arm/dl-machine.h (elf_machine_load_address): Use
+	_dl_relocate_static_pie instead of _dl_start to compute load
+	address in static PIE.  Return 0 if _DYNAMIC is undefined for
+	static executable.
+
+2017-09-29  H.J. Lu  <hongjiu.lu@intel.com>
+
 	* sysdeps/mips/dl-machine.h (elf_machine_dynamic): Return 0 if
 	_DYNAMIC is undefined for static executable.
 
diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h
index 7d733f2..efe2e1b 100644
--- a/sysdeps/arm/dl-machine.h
+++ b/sysdeps/arm/dl-machine.h
@@ -53,10 +53,20 @@ elf_machine_dynamic (void)
 static inline Elf32_Addr __attribute__ ((unused))
 elf_machine_load_address (void)
 {
+  Elf32_Addr pcrel_addr;
+#ifdef SHARED
   extern Elf32_Addr __dl_start (void *) asm ("_dl_start");
   Elf32_Addr got_addr = (Elf32_Addr) &__dl_start;
-  Elf32_Addr pcrel_addr;
   asm ("adr %0, _dl_start" : "=r" (pcrel_addr));
+#else
+  extern Elf32_Dyn _DYNAMIC[] __attribute__((weak, visibility ("hidden")));
+  if (!_DYNAMIC)
+    return 0;
+  extern Elf32_Addr __dl_relocate_static_pie (void *)
+    asm ("_dl_relocate_static_pie") attribute_hidden;
+  Elf32_Addr got_addr = (Elf32_Addr) &__dl_relocate_static_pie;
+  asm ("adr %0, _dl_relocate_static_pie" : "=r" (pcrel_addr));
+#endif
 #ifdef __thumb__
   /* Clear the low bit of the function address.
 

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

Summary of changes:
 ChangeLog                |    7 +++++++
 sysdeps/arm/dl-machine.h |   12 +++++++++++-
 2 files changed, 18 insertions(+), 1 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]