diff options
author | Eric Andersen <andersen@codepoet.org> | 2006-11-04 20:14:10 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2006-11-04 20:14:10 +0000 |
commit | bcd949c7f80ccf66c8ef869367a9b33dbb51a261 (patch) | |
tree | 981e52a9924916366df69688e042f3ad427a22c4 /ldso/ldso/mips/resolve.S | |
parent | 980871f06dc4b2359b589fd9d720ed3fc8c3a925 (diff) |
mips64 patch from Atsushi Nemoto:
64bit MIPS ELF format tweaks. (from glibc)
Elf32/ElfW convertions.
asm code adjustments.
Diffstat (limited to 'ldso/ldso/mips/resolve.S')
-rw-r--r-- | ldso/ldso/mips/resolve.S | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/ldso/ldso/mips/resolve.S b/ldso/ldso/mips/resolve.S index 6dc89643e..f7b286252 100644 --- a/ldso/ldso/mips/resolve.S +++ b/ldso/ldso/mips/resolve.S @@ -12,12 +12,14 @@ * */ +#include <sgidefs.h> .text .align 2 .globl _dl_runtime_resolve .type _dl_runtime_resolve,@function .ent _dl_runtime_resolve _dl_runtime_resolve: +#if _MIPS_SIM == _MIPS_SIM_ABI32 .frame $29, 40, $31 .set noreorder @@ -60,6 +62,51 @@ _dl_runtime_resolve: # Do a tail call to the original function addiu $29, 40 +#else /* N32 || N64 */ + .set noreorder + + # Save GP. + move $3, $28 + + # Save arguments and sp value on stack. + dsubu $29, 80 + + # Compute GP. + .set noreorder + .cpsetup $25, 0, _dl_runtime_resolve + .set reorder + + # Store function arguments from registers to stack + sd $15, 72($29) + sd $4, 8($29) + sd $5, 16($29) + sd $6, 24($29) + sd $7, 32($29) + sd $8, 40($29) + sd $9, 48($29) + sd $10, 56($29) + sd $11, 64($29) + + # Setup functions args and call __dl_runtime_resolve + move $4, $24 + move $5, $3 + jal __dl_runtime_resolve + + # Restore function arguments from stack to registers + ld $31, 72($29) + ld $4, 8($29) + ld $5, 16($29) + ld $6, 24($29) + ld $7, 32($29) + ld $8, 40($29) + ld $9, 48($29) + ld $10, 56($29) + ld $11, 64($29) + + # Do a tail call to the original function + .cpreturn + daddu $29, 80 +#endif /* N32 || N64 */ move $25, $2 jr $25 .end _dl_runtime_resolve |