From 39624db737b70fa6a4f374262d014aa4b73e7456 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 10 Jun 2005 07:22:28 +0000 Subject: Finish updating mips for the new ABI --- ldso/ldso/mips/resolve.S | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) (limited to 'ldso/ldso/mips/resolve.S') diff --git a/ldso/ldso/mips/resolve.S b/ldso/ldso/mips/resolve.S index 8b492947d..6dc89643e 100644 --- a/ldso/ldso/mips/resolve.S +++ b/ldso/ldso/mips/resolve.S @@ -11,6 +11,7 @@ * Copyright (C) 2002 Steven J. Hill * */ + .text .align 2 .globl _dl_runtime_resolve @@ -19,27 +20,48 @@ _dl_runtime_resolve: .frame $29, 40, $31 .set noreorder - move $3, $28 # Save GP - addu $25, 8 # t9 ($25) now points at .cpload instruction - .cpload $25 # Compute GP - .set reorder + + # Save GP. + move $3, $28 + + # Save arguments and sp value on stack. subu $29, 40 + + # Modify t9 ($25) so as to point .cpload instruction. + addiu $25, 12 + + # Compute GP. + .set noreorder + .cpload $25 + .set reorder + + # Save slot call pc. + move $2, $31 .cprestore 32 + + # Store function arguments from registers to stack sw $15, 36($29) sw $4, 16($29) sw $5, 20($29) sw $6, 24($29) sw $7, 28($29) + + # Setup functions args and call __dl_runtime_resolve move $4, $24 move $5, $3 - jal __dl_runtime_resolve + jal __dl_runtime_resolve + + # Restore function arguments from stack to registers lw $31, 36($29) lw $4, 16($29) lw $5, 20($29) lw $6, 24($29) lw $7, 28($29) - addu $29, 40 + + # Do a tail call to the original function + addiu $29, 40 move $25, $2 jr $25 -.size _dl_runtime_resolve,.-_dl_runtime_resolve -.end _dl_runtime_resolve +.end _dl_runtime_resolve +.previous + -- cgit v1.2.3