|
Packit Service |
82fcde |
/* PLT trampolines. m68k version.
|
|
Packit Service |
82fcde |
Copyright (C) 2005-2018 Free Software Foundation, Inc.
|
|
Packit Service |
82fcde |
This file is part of the GNU C Library.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit Service |
82fcde |
modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
82fcde |
License as published by the Free Software Foundation; either
|
|
Packit Service |
82fcde |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit Service |
82fcde |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
82fcde |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
82fcde |
Lesser General Public License for more details.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
82fcde |
License along with the GNU C Library. If not, see
|
|
Packit Service |
82fcde |
<http://www.gnu.org/licenses/>. */
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#include <sysdep.h>
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#if !defined (__mcoldfire__)
|
|
Packit Service |
82fcde |
# define FMOVE fmove.x
|
|
Packit Service |
82fcde |
# define FPSPACE 12
|
|
Packit Service |
82fcde |
#elif defined (__mcffpu__)
|
|
Packit Service |
82fcde |
# define FMOVE fmove.d
|
|
Packit Service |
82fcde |
# define FPSPACE 8
|
|
Packit Service |
82fcde |
#else
|
|
Packit Service |
82fcde |
# define FPSPACE 0
|
|
Packit Service |
82fcde |
#endif
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
.text
|
|
Packit Service |
82fcde |
.globl _dl_runtime_resolve
|
|
Packit Service |
82fcde |
.type _dl_runtime_resolve, @function
|
|
Packit Service |
82fcde |
_dl_runtime_resolve:
|
|
Packit Service |
82fcde |
cfi_startproc
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (8)
|
|
Packit Service |
82fcde |
| Save %a0 (struct return address) and %a1.
|
|
Packit Service |
82fcde |
move.l %a0, -(%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
move.l %a1, -(%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
| Call the real address resolver.
|
|
Packit Service |
82fcde |
jbsr _dl_fixup
|
|
Packit Service |
82fcde |
| Restore register %a0 and %a1.
|
|
Packit Service |
82fcde |
move.l (%sp)+, %a1
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (-4)
|
|
Packit Service |
82fcde |
move.l (%sp)+, %a0
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (-4)
|
|
Packit Service |
82fcde |
| Pop parameters
|
|
Packit Service |
82fcde |
addq.l #8, %sp
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (-8)
|
|
Packit Service |
82fcde |
| Call real function.
|
|
Packit Service |
82fcde |
#ifdef __mcoldfire__
|
|
Packit Service |
82fcde |
move.l %d0,-(%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
rts
|
|
Packit Service |
82fcde |
#else
|
|
Packit Service |
82fcde |
jmp (%d0)
|
|
Packit Service |
82fcde |
#endif
|
|
Packit Service |
82fcde |
cfi_endproc
|
|
Packit Service |
82fcde |
.size _dl_runtime_resolve, . - _dl_runtime_resolve
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
.text
|
|
Packit Service |
82fcde |
.globl _dl_runtime_profile
|
|
Packit Service |
82fcde |
.type _dl_runtime_profile, @function
|
|
Packit Service |
82fcde |
_dl_runtime_profile:
|
|
Packit Service |
82fcde |
cfi_startproc
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (8)
|
|
Packit Service |
82fcde |
pea 8(%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
move.l %a1, -(%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
move.l %a0, -(%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
pea -1.w
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
| Push parameters for _dl_profile_fixup
|
|
Packit Service |
82fcde |
pea (%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
pea 8(%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
move.l 32(%sp), -(%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
move.l 32(%sp), -(%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
move.l 32(%sp), -(%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
subq.l #8, %sp
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (8)
|
|
Packit Service |
82fcde |
| Call the real address resolver.
|
|
Packit Service |
82fcde |
jbsr _dl_profile_fixup
|
|
Packit Service |
82fcde |
| Pop parameters
|
|
Packit Service |
82fcde |
lea 28(%sp), %sp
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (-28)
|
|
Packit Service |
82fcde |
move.l (%sp), %d1
|
|
Packit Service |
82fcde |
jpl 1f
|
|
Packit Service |
82fcde |
addq.l #4, %sp
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (-4)
|
|
Packit Service |
82fcde |
| Restore register %a0 and %a1.
|
|
Packit Service |
82fcde |
move.l (%sp)+, %a0
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (-4)
|
|
Packit Service |
82fcde |
move.l (%sp)+, %a1
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (-4)
|
|
Packit Service |
82fcde |
lea 12(%sp), %sp
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (-12)
|
|
Packit Service |
82fcde |
| Call real function.
|
|
Packit Service |
82fcde |
#ifdef __mcoldfire__
|
|
Packit Service |
82fcde |
move.l %d0,-(%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
rts
|
|
Packit Service |
82fcde |
#else
|
|
Packit Service |
82fcde |
jmp (%d0)
|
|
Packit Service |
82fcde |
#endif
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
/*
|
|
Packit Service |
82fcde |
+24 return address
|
|
Packit Service |
82fcde |
+20 PLT1
|
|
Packit Service |
82fcde |
+16 PLT2
|
|
Packit Service |
82fcde |
+12 %sp
|
|
Packit Service |
82fcde |
+8 %a1
|
|
Packit Service |
82fcde |
+4 %a0
|
|
Packit Service |
82fcde |
%sp free
|
|
Packit Service |
82fcde |
*/
|
|
Packit Service |
82fcde |
#ifdef __mcoldfire__
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (20)
|
|
Packit Service |
82fcde |
#else
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (24)
|
|
Packit Service |
82fcde |
#endif
|
|
Packit Service |
82fcde |
1: move.l %a2, (%sp)
|
|
Packit Service |
82fcde |
cfi_rel_offset (%a2, 0)
|
|
Packit Service |
82fcde |
move.l %sp, %a2
|
|
Packit Service |
82fcde |
move.l %sp, %a0
|
|
Packit Service |
82fcde |
lea 28(%sp), %a1
|
|
Packit Service |
82fcde |
| Round framesize up to longword alignment
|
|
Packit Service |
82fcde |
addq.l #3, %d1
|
|
Packit Service |
82fcde |
and.l #-3, %d1
|
|
Packit Service |
82fcde |
sub.l %d1, %a0
|
|
Packit Service |
82fcde |
move.l %a0, %sp
|
|
Packit Service |
82fcde |
cfi_def_cfa_register (%a2)
|
|
Packit Service |
82fcde |
#ifdef __mcoldfire__
|
|
Packit Service |
82fcde |
tst.l %d1
|
|
Packit Service |
82fcde |
beq 2f
|
|
Packit Service |
82fcde |
1: move.l (%a1)+, (%a0)+
|
|
Packit Service |
82fcde |
subq.l #4,%d1
|
|
Packit Service |
82fcde |
bne 1b
|
|
Packit Service |
82fcde |
2:
|
|
Packit Service |
82fcde |
#else
|
|
Packit Service |
82fcde |
lsr.l #2,%d1
|
|
Packit Service |
82fcde |
jra 2f
|
|
Packit Service |
82fcde |
1: move.l (%a1)+, (%a0)+
|
|
Packit Service |
82fcde |
2: dbra %d1,1b
|
|
Packit Service |
82fcde |
#endif
|
|
Packit Service |
82fcde |
/*
|
|
Packit Service |
82fcde |
%a2+24 return address
|
|
Packit Service |
82fcde |
%a2+20 PLT1
|
|
Packit Service |
82fcde |
%a2+16 PLT2
|
|
Packit Service |
82fcde |
%a2+12 %sp
|
|
Packit Service |
82fcde |
%a2+8 %a1
|
|
Packit Service |
82fcde |
%a2+4 %a0
|
|
Packit Service |
82fcde |
%a2 %a2
|
|
Packit Service |
82fcde |
%sp copied stack frame
|
|
Packit Service |
82fcde |
*/
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
move.l 4(%a2), %a0
|
|
Packit Service |
82fcde |
move.l 8(%a2), %a1
|
|
Packit Service |
82fcde |
#ifdef __mcoldfire__
|
|
Packit Service |
82fcde |
pea 2f(%pc)
|
|
Packit Service |
82fcde |
move.l %d0,-(%sp)
|
|
Packit Service |
82fcde |
rts
|
|
Packit Service |
82fcde |
2:
|
|
Packit Service |
82fcde |
#else
|
|
Packit Service |
82fcde |
jsr (%d0)
|
|
Packit Service |
82fcde |
#endif
|
|
Packit Service |
82fcde |
move.l %a2, %sp
|
|
Packit Service |
82fcde |
cfi_def_cfa_register (%sp)
|
|
Packit Service |
82fcde |
move.l (%sp)+, %a2
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
cfi_restore (%a2)
|
|
Packit Service |
82fcde |
/*
|
|
Packit Service |
82fcde |
+20 return address
|
|
Packit Service |
82fcde |
+16 PLT1
|
|
Packit Service |
82fcde |
+12 PLT2
|
|
Packit Service |
82fcde |
+8 %sp
|
|
Packit Service |
82fcde |
+4 %a1
|
|
Packit Service |
82fcde |
%sp %a0
|
|
Packit Service |
82fcde |
*/
|
|
Packit Service |
82fcde |
#ifdef FMOVE
|
|
Packit Service |
82fcde |
FMOVE %fp0, -(%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (FPSPACE)
|
|
Packit Service |
82fcde |
#endif
|
|
Packit Service |
82fcde |
move.l %a0, -(%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
move.l %d1, -(%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
move.l %d0, -(%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
pea (%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
pea (16+FPSPACE)(%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
move.l (32+FPSPACE)(%sp), -(%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
move.l (32+FPSPACE)(%sp), -(%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
jbsr _dl_call_pltexit
|
|
Packit Service |
82fcde |
lea 16(%sp), %sp
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (-16)
|
|
Packit Service |
82fcde |
move.l (%sp)+, %d0
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (-4)
|
|
Packit Service |
82fcde |
move.l (%sp)+, %d1
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (-4)
|
|
Packit Service |
82fcde |
move.l (%sp)+, %a0
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (-4)
|
|
Packit Service |
82fcde |
#ifdef FMOVE
|
|
Packit Service |
82fcde |
FMOVE (%sp)+, %fp0
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (-FPSPACE)
|
|
Packit Service |
82fcde |
#endif
|
|
Packit Service |
82fcde |
lea 20(%sp), %sp
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (-20)
|
|
Packit Service |
82fcde |
rts
|
|
Packit Service |
82fcde |
cfi_endproc
|
|
Packit Service |
82fcde |
.size _dl_runtime_profile, . - _dl_runtime_profile
|