Skip to content

Commit

Permalink
2015-01-05 Steve Ellcey <sellcey@imgtec.com>
Browse files Browse the repository at this point in the history
	* sysdeps/mips/dl-machine.h (elf_machine_load_address): Replace
	bltzal with addiupc.
	(RTLD_START): Ditto.
  • Loading branch information
Steve Ellcey committed Jan 5, 2015
1 parent 7ea793f commit 03403e3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2015-01-05 Steve Ellcey <sellcey@imgtec.com>

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

2015-01-05 Chris Metcalf <cmetcalf@ezchip.com>

* sysdeps/unix/sysv/linux/tile/bits/libc-vdso.h: Fix return type
Expand Down
19 changes: 16 additions & 3 deletions sysdeps/mips/dl-machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#endif

#include <sgidefs.h>
#include <sysdep.h>
#include <sys/asm.h>
#include <dl-tls.h>

Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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) "\
Expand All @@ -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\
Expand Down

0 comments on commit 03403e3

Please sign in to comment.