1 /* vi: set sw=8 ts=8: */
3 * ldso/ldso/sh64/resolve.S
5 * SuperH (sh64) dynamic resolver support
7 * Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. The name of the above contributors may not be
17 * used to endorse or promote products derived from this software
18 * without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .section .text..SHmedia32,"ax"
34 .globl _dl_linux_resolver
35 .globl _dl_linux_resolve
36 .type _dl_linux_resolve, @function
40 addi r15, -72, r15 ! make room on the stack
41 pt _dl_linux_resolver, tr0
42 st.q r15, 0, r2 ! save regs
53 addi r15, -48, r15 ! make room for FP regs
54 fst.d r15, 0, dr0 ! save FP regs
63 * Args for _dl_linux_resolver(), set in r17/r21 by PLT code
66 add r17, r63, r2 ! link map address
67 add r21, r63, r3 ! GOT offset
68 blink tr0, r18 ! call _dl_linux_resolver()
69 ptabs/l r2, tr0 ! save result = addr of function called
72 fld.d r15, 0, dr0 ! restore FP regs
81 ld.q r15, 0, r2 ! restore regs
92 blink tr0, r63 ! jump to function address
94 .size _dl_linux_resolve, . - _dl_linux_resolve