OSDN Git Service

More mips support from sjhill
[uclinux-h8/uClibc.git] / ldso / ldso / mips / resolve.S
1 /*
2  * Linux dynamic resolving code for MIPS. Fixes up the GOT entry as
3  * indicated in register t8 and jumps to the resolved address. Shamelessly
4  * ripped from 'sysdeps/mips/dl-machine.h' in glibc-2.2.5.
5  *
6  * This file is subject to the terms and conditions of the GNU General Public
7  * License.  See the file "COPYING.LIB" in the main directory of this archive
8  * for more details.
9  *
10  * Copyright (C) 1996-2001 Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>
11  * Copyright (C) 2002 Steven J. Hill <sjhill@realitydiluted.com>
12  *
13  */
14 .text
15 .align  2
16 .globl  _dl_linux_resolve
17 .type   _dl_linux_resolve,@function
18 .ent    _dl_linux_resolve
19 _dl_linux_resolve:
20         .frame  $29, 40, $31
21         .set noreorder
22         move    $3, $28         # Save GP
23         addu    $25, 8          # t9 ($25) now points at .cpload instruction
24         .cpload $25             # Compute GP
25         .set reorder
26         move    $2, $31         # Save slot call pc
27         subu    $29, 40         # Save arguments and sp value in stack
28         .cprestore 32
29         sw      $15, 36($29)
30         sw      $4, 16($29)
31         sw      $5, 20($29)
32         sw      $6, 24($29)
33         sw      $7, 28($29)
34         move    $4, $24
35         move    $5, $15
36         move    $6, $3
37         move    $7, $2
38         jal     _dl_linux_resolver
39         lw      $31, 36($29)
40         lw      $4, 16($29)
41         lw      $5, 20($29)
42         lw      $6, 24($29)
43         lw      $7, 28($29)
44         addu    $29, 40
45         move    $25, $2
46         jr      $25
47 .size _dl_linux_resolve,.-_dl_linux_resolve
48 .end _dl_linux_resolve