]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
m68k: Update elf_machine_load_address for static PIE
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 20 Oct 2017 10:36:34 +0000 (03:36 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 20 Oct 2017 10:36:47 +0000 (03:36 -0700)
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/m68k/dl-machine.h (elf_machine_load_address): Use
_dl_relocate_static_pie instead of _dl_start to compute load
address in static PIE.

ChangeLog
sysdeps/m68k/dl-machine.h

index 138eea5ffd43fbeb3d7da8f6aeec14c72faba8f2..e5e89cec187903a77c40a10085131a95b84efbda 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-10-20  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * sysdeps/m68k/dl-machine.h (elf_machine_load_address): Use
+       _dl_relocate_static_pie instead of _dl_start to compute load
+       address in static PIE.
+
 2017-10-20  H.J. Lu  <hongjiu.lu@intel.com>
 
        * sysdeps/m68k/start.S (_start): Check PIC instead of SHARED.
index fd8fb001031bd729d0a13ea7ce597b3f336e8afd..33a5f7652421b5942d7b038c8542e28b841348ee 100644 (file)
@@ -51,9 +51,15 @@ static inline Elf32_Addr
 elf_machine_load_address (void)
 {
   Elf32_Addr addr;
+#ifdef SHARED
   asm (PCREL_OP ("lea", "_dl_start", "%0", "%0", "%%pc") "\n\t"
        "sub.l _dl_start@GOT.w(%%a5), %0"
        : "=a" (addr));
+#else
+  asm (PCREL_OP ("lea", "_dl_relocate_static_pie", "%0", "%0", "%%pc") "\n\t"
+       "sub.l _dl_relocate_static_pie@GOT.w(%%a5), %0"
+       : "=a" (addr));
+#endif
   return addr;
 }