1 /* PLT trampolines. x86-64 version.
2 Copyright (C) 2004, 2005 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(96) # Incorporate PLT
67 movq %rax, (%rsp) # Preserve registers otherwise clobbered.
74 movq %rbp, 56(%rsp) # Information for auditors.
78 movq 96(%rsp), %rdx # Load return address if needed
79 movq 88(%rsp), %rsi # Copy args pushed by PLT in register.
80 movq %rsi,%r11 # Multiply by 24
84 movq 80(%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 $96,%rsp # Adjust stack
99 cfi_adjust_cfa_offset (-96)
100 jmp *%r11 # Jump to function address.
117 cfi_adjust_cfa_offset (96)
118 1: movq %rbx, 72(%rsp)
119 cfi_rel_offset (1, 72)
122 cfi_def_cfa_register (1)
129 andq $0xfffffffffffffff0, %rsp
135 cfi_def_cfa_register (7)
137 cfi_adjust_cfa_offset (72)
141 /* Even though the stack is correctly aligned to allow using movaps
142 we use movups. Some callers might provide an incorrectly aligned
143 stack and we do not want to have it blow up here. */
144 movups %xmm0, 16(%rcx)
145 movups %xmm1, 32(%rcx)
171 movq 160(%rsp), %rsi # Copy args pushed by PLT in register.
172 movq %rsi,%r11 # Multiply by 24
176 movq 152(%rsp), %rdi # %rdi: link_map, %rsi: reloc_offset
177 call _dl_call_pltexit
180 movups 16(%rsp), %xmm0
181 movups 32(%rsp), %xmm1
185 cfi_adjust_cfa_offset (-168)
188 .size _dl_runtime_profile, .-_dl_runtime_profile