1 /* PLT trampolines. x86-64 version.
2 Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
23 .globl _dl_runtime_resolve
24 .type _dl_runtime_resolve, @function
29 cfi_adjust_cfa_offset(72) # Incorporate PLT
30 movq %rax,(%rsp) # Preserve registers otherwise clobbered.
37 movq 64(%rsp), %rsi # Copy args pushed by PLT in register.
38 movq %rsi, %r11 # Multiply by 24
42 movq 56(%rsp), %rdi # %rdi: link_map, %rsi: reloc_offset
43 call _dl_fixup # Call resolver.
44 movq %rax, %r11 # Save return value
45 movq 48(%rsp), %r9 # Get register content back.
52 addq $72, %rsp # Adjust stack(PLT did 2 pushes)
53 cfi_adjust_cfa_offset(-72)
54 jmp *%r11 # Jump to function address.
56 .size _dl_runtime_resolve, .-_dl_runtime_resolve
60 .globl _dl_runtime_profile
61 .type _dl_runtime_profile, @function
66 cfi_adjust_cfa_offset(104) # Incorporate PLT
67 movq %rax, (%rsp) # Preserve registers otherwise clobbered.
74 movq %rbp, 56(%rsp) # Information for auditors.
78 movq 104(%rsp), %rdx # Load return address if needed
79 movq 96(%rsp), %rsi # Copy args pushed by PLT in register.
80 movq %rsi,%r11 # Multiply by 24
84 movq 88(%rsp), %rdi # %rdi: link_map, %rsi: reloc_offset
86 call _dl_profile_fixup # Call resolver.
87 movq %rax, %r11 # Save return value
88 movq 8(%rsp), %rdx # Get back register content.
98 addq $104,%rsp # Adjust stack
99 cfi_adjust_cfa_offset (-104)
100 jmp *%r11 # Jump to function address.
118 cfi_adjust_cfa_offset (104)
119 1: movq %rbx, 72(%rsp)
120 cfi_rel_offset (rbx, 72)
123 cfi_def_cfa_register (%rbx)
126 andq $0xfffffffffffffff0, %r10
137 cfi_def_cfa_register (%rsp)
139 cfi_adjust_cfa_offset (72)
143 /* Even though the stack is correctly aligned to allow using movaps
144 we use movups. Some callers might provide an incorrectly aligned
145 stack and we do not want to have it blow up here. */
146 movups %xmm0, 16(%rcx)
147 movups %xmm1, 32(%rcx)
174 movq 168(%rsp), %rsi # Copy args pushed by PLT in register.
175 movq %rsi,%r11 # Multiply by 24
179 movq 160(%rsp), %rdi # %rdi: link_map, %rsi: reloc_offset
180 call _dl_call_pltexit
183 movups 16(%rsp), %xmm0
184 movups 32(%rsp), %xmm1
188 cfi_adjust_cfa_offset (-176)
191 .size _dl_runtime_profile, .-_dl_runtime_profile