This is the mail archive of the libc-alpha@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]

[Patch, MIPS] Modify dl-machine.h for mips32r6/mips64r6


Here is a second patch to support mips32r6/mips64r6.  This one replaces
the use of bltzal with bal in dl-machine.h.  bltzal was removed from
mips32r6 and mips64r6 and the new bal instruction is used as a replacement
to accomplish the same branch-and-link operation.

Tested with the mips32r6/mips64r6 GCC, binutils and qemu simulator.

OK to checkin?

Steve Ellcey
sellcey@imgtec.com


2014-12-19  Steve Ellcey  <sellcey@imgtec.com>

	* sysdeps/mips/dl-machine.h (elf_machine_load_address): Replace
	bltzal with bal.
	(RTLD_START): Ditto.


diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h
index 5000d2a..8885c80 100644
--- a/sysdeps/mips/dl-machine.h
+++ b/sysdeps/mips/dl-machine.h
@@ -138,7 +138,11 @@ 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"
+#else
+       "	bal 0f\n"
+#endif
        "	nop\n"
        "0:	" STRINGXP (PTR_SUBU) " %0, $31, %0\n"
        "	.set reorder\n"
@@ -241,6 +245,11 @@ do {									\
       and not just plain _start.  */
 
 #ifndef __mips16
+#if __mips_isa_rev < 6
+#define LOAD_31 STRINGXP(bltzal $8) "," STRINGXP(.Lcoff)
+#else
+#define LOAD_31 STRINGXP(bal .Lcoff)
+#endif
 # define RTLD_START asm (\
 	".text\n\
 	" _RTLD_PROLOGUE(ENTRY_POINT) "\
@@ -256,7 +265,7 @@ do {									\
 	" STRINGXP(PTR_SUBIU) " $29, 16\n\
 	\n\
 	" STRINGXP(PTR_LA) " $8, .Lcoff\n\
-	bltzal $8, .Lcoff\n\
+	" LOAD_31 "\n\
 .Lcoff:	" STRINGXP(PTR_SUBU) " $8, $31, $8\n\
 	\n\
 	" STRINGXP(PTR_LA) " $25, _dl_start\n\


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]