OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / uClibc / ldso / ldso / avr32 / resolve.S
1 /*
2  * Linux dynamic resolving code for AVR32. Fixes up the GOT entry as
3  * indicated in register r12 and jumps to the resolved address.
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser General
6  * Public License.  See the file "COPYING.LIB" in the main directory of this
7  * archive for more details.
8  *
9  * Copyright (C) 2004-2007 Atmel Corporation
10  */
11
12 #define ip r5
13
14         .text
15         .global _dl_linux_resolve
16         .type   _dl_linux_resolve,@function
17 _dl_linux_resolve:
18         /* The PLT code pushed r8 for us. It contains the address of this
19            function's GOT entry, that is entry 0. ip contains the address
20            of the GOT entry of the function we wanted to call. */
21         stm     --sp, r9-r12, lr
22         mov     r11, r8
23         sub     r12, ip, r8
24         rcall   _dl_linux_resolver
25         mov     ip, r12
26         popm    r8-r12,lr
27         mov     pc, ip
28         .size   _dl_linux_resolve, . - _dl_linux_resolve