summaryrefslogtreecommitdiff
path: root/sysdeps/m68k
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-10-20 03:36:34 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-10-20 03:36:47 -0700
commit9ba7e81028b3313d9aeb97a98d2e37626694d442 (patch)
treedd07a362a5dcdbf64780757d49179faa22487b00 /sysdeps/m68k
parent4027a4fda011c4431bdc3a063963de0b6fd6c07e (diff)
m68k: 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/m68k/dl-machine.h (elf_machine_load_address): Use _dl_relocate_static_pie instead of _dl_start to compute load address in static PIE.
Diffstat (limited to 'sysdeps/m68k')
-rw-r--r--sysdeps/m68k/dl-machine.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/m68k/dl-machine.h b/sysdeps/m68k/dl-machine.h
index fd8fb00103..33a5f76524 100644
--- a/sysdeps/m68k/dl-machine.h
+++ b/sysdeps/m68k/dl-machine.h
@@ -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;
}