OSDN Git Service

buildsys: cache build flags in vars
[uclinux-h8/uClibc.git] / ldso / ldso / powerpc / resolve.S
1 /*
2  * Stolen from glibc-2.2.2 by David Schleef <ds@schleef.org>
3  */
4
5 .text
6 .align 4
7
8 .globl _dl_linux_resolver
9
10 .globl _dl_linux_resolve
11 .type   _dl_linux_resolve,@function
12
13 _dl_linux_resolve:
14 /* We need to save the registers used to pass parameters, and register 0,
15    which is used by _mcount; the registers are saved in a stack frame.  */
16         stwu 1,-64(1)
17         stw 0,12(1)
18         stw 3,16(1)
19         stw 4,20(1)
20 /* The code that calls this has put parameters for 'fixup' in r12 and r11. */
21         mr 3,12
22         stw 5,24(1)
23         mr 4,11
24         stw 6,28(1)
25         mflr 0
26 /* We also need to save some of the condition register fields. */
27         stw 7,32(1)
28         stw 0,48(1)
29         stw 8,36(1)
30         mfcr 0
31         stw 9,40(1)
32         stw 10,44(1)
33         stw 0,8(1)
34         bl _dl_linux_resolver@local
35 /* 'fixup' returns the address we want to branch to. */
36         mtctr 3
37 /* Put the registers back... */
38         lwz 0,48(1)
39         lwz 10,44(1)
40         lwz 9,40(1)
41         mtlr 0
42         lwz 8,36(1)
43         lwz 0,8(1)
44         lwz 7,32(1)
45         lwz 6,28(1)
46         mtcrf 0xFF,0
47         lwz 5,24(1)
48         lwz 4,20(1)
49         lwz 3,16(1)
50         lwz 0,12(1)
51 /* ...unwind the stack frame, and jump to the PLT entry we updated. */
52         addi 1,1,64
53         bctr
54
55 .LFE2:
56         .size _dl_linux_resolve,.LFE2-_dl_linux_resolve
57