aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/mips
diff options
context:
space:
mode:
authorSteve Ellcey <sellcey@mips.com>2015-01-05 09:39:33 -0800
committerSteve Ellcey <sellcey@mips.com>2015-01-05 09:39:33 -0800
commit03403e3061d33048e287cf712627001e6784dcb4 (patch)
tree021035f7d924b956e484455fba1247ef95891009 /sysdeps/mips
parent7ea793f39ca1362bc1d6587d29b1e7f52eb8a9a1 (diff)
downloadglibc-03403e3061d33048e287cf712627001e6784dcb4.tar
glibc-03403e3061d33048e287cf712627001e6784dcb4.tar.gz
glibc-03403e3061d33048e287cf712627001e6784dcb4.tar.bz2
glibc-03403e3061d33048e287cf712627001e6784dcb4.zip
2015-01-05 Steve Ellcey <sellcey@imgtec.com>
* sysdeps/mips/dl-machine.h (elf_machine_load_address): Replace bltzal with addiupc. (RTLD_START): Ditto.
Diffstat (limited to 'sysdeps/mips')
-rw-r--r--sysdeps/mips/dl-machine.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h
index a8df58efd6..d63238a4fe 100644
--- a/sysdeps/mips/dl-machine.h
+++ b/sysdeps/mips/dl-machine.h
@@ -30,6 +30,7 @@
#endif
#include <sgidefs.h>
+#include <sysdep.h>
#include <sys/asm.h>
#include <dl-tls.h>
@@ -143,9 +144,14 @@ elf_machine_load_address (void)
#ifndef __mips16
asm (" .set noreorder\n"
" " STRINGXP (PTR_LA) " %0, 0f\n"
+# if __mips_isa_rev < 6
" bltzal $0, 0f\n"
" nop\n"
"0: " STRINGXP (PTR_SUBU) " %0, $31, %0\n"
+# else
+ "0: addiupc $31, 0\n"
+ " " STRINGXP (PTR_SUBU) " %0, $31, %0\n"
+# endif
" .set reorder\n"
: "=r" (addr)
: /* No inputs */
@@ -246,6 +252,13 @@ do { \
and not just plain _start. */
#ifndef __mips16
+# if __mips_isa_rev < 6
+# define LCOFF STRINGXP(.Lcof2)
+# define LOAD_31 STRINGXP(bltzal $8) "," STRINGXP(.Lcof2)
+# else
+# define LCOFF STRINGXP(.Lcof1)
+# define LOAD_31 "addiupc $31, 0"
+# endif
# define RTLD_START asm (\
".text\n\
" _RTLD_PROLOGUE(ENTRY_POINT) "\
@@ -260,9 +273,9 @@ do { \
move $4, $29\n\
" STRINGXP(PTR_SUBIU) " $29, 16\n\
\n\
- " STRINGXP(PTR_LA) " $8, .Lcoff\n\
- bltzal $8, .Lcoff\n\
-.Lcoff: " STRINGXP(PTR_SUBU) " $8, $31, $8\n\
+ " STRINGXP(PTR_LA) " $8, " LCOFF "\n\
+.Lcof1: " LOAD_31 "\n\
+.Lcof2: " STRINGXP(PTR_SUBU) " $8, $31, $8\n\
\n\
" STRINGXP(PTR_LA) " $25, _dl_start\n\
" STRINGXP(PTR_ADDU) " $25, $8\n\