OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [uClibc/] [ldso/] [ldso/] [powerpc/] [resolve.S] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
/*
2
 * Stolen from glibc-2.2.2 by David Schleef 
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
 
58
#if 0
59
 
60
        pusha                           /* preserve all regs */
61
        lea     0x20(%esp),%eax         /* eax = tpnt and reloc_entry params */
62
        pushl   4(%eax)                 /* push copy of reloc_entry param */
63
        pushl   (%eax)                  /* push copy of tpnt param */
64
 
65
#ifdef __PIC__
66
        call    .L24
67
.L24:
68
        popl    %ebx
69
        addl    $_GLOBAL_OFFSET_TABLE_+[.-.L24],%ebx
70
        movl _dl_linux_resolver@GOT(%ebx),%ebx  /* eax = resolved func */
71
        call *%ebx
72
#else
73
        call _dl_linux_resolver
74
#endif
75
        movl    %eax,0x28(%esp)         /* store func addr over original
76
                                         * tpnt param */
77
        addl    $0x8,%esp               /* remove copy parameters */
78
        popa                            /* restore regs */
79
        ret     $4                      /* jump to func removing original
80
                                         * reloc_entry param from stack */
81
#endif
82
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.