1 /* PLT trampolines. i386 version.
2 Copyright (C) 2004-2015 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, see
17 <http://www.gnu.org/licenses/>. */
22 .globl _dl_runtime_resolve
23 .type _dl_runtime_resolve, @function
27 cfi_adjust_cfa_offset (8)
28 pushl %eax # Preserve registers otherwise clobbered.
29 cfi_adjust_cfa_offset (4)
31 cfi_adjust_cfa_offset (4)
33 cfi_adjust_cfa_offset (4)
34 movl 16(%esp), %edx # Copy args pushed by PLT in register. Note
35 movl 12(%esp), %eax # that `fixup' takes its parameters in regs.
36 call _dl_fixup # Call resolver.
37 popl %edx # Get register content back.
38 cfi_adjust_cfa_offset (-4)
40 movl %eax, (%esp) # Store the function address.
42 ret $12 # Jump to function address.
44 .size _dl_runtime_resolve, .-_dl_runtime_resolve
48 .globl _dl_runtime_profile
49 .type _dl_runtime_profile, @function
53 cfi_adjust_cfa_offset (8)
55 cfi_adjust_cfa_offset (4)
56 addl $8, (%esp) # Account for the pushed PLT data
58 cfi_adjust_cfa_offset (4)
59 pushl %eax # Preserve registers otherwise clobbered.
60 cfi_adjust_cfa_offset (4)
62 cfi_adjust_cfa_offset (4)
64 cfi_adjust_cfa_offset (4)
67 cfi_adjust_cfa_offset (8)
71 pushl %ecx # Address of the register structure
72 cfi_adjust_cfa_offset (4)
73 movl 40(%esp), %ecx # Load return address
74 movl 36(%esp), %edx # Copy args pushed by PLT in register. Note
75 movl 32(%esp), %eax # that `fixup' takes its parameters in regs.
76 call _dl_profile_fixup # Call resolver.
77 cfi_adjust_cfa_offset (-8)
82 cfi_adjust_cfa_offset (-4)
83 popl %edx # Get register content back.
84 cfi_adjust_cfa_offset (-4)
86 movl %eax, (%esp) # Store the function address.
88 ret $20 # Jump to function address.
101 cfi_adjust_cfa_offset (8)
103 cfi_rel_offset (ebx, 0)
104 movl %edx, %ebx # This is the frame buffer size
106 cfi_adjust_cfa_offset (4)
107 cfi_rel_offset (edi, 0)
109 cfi_adjust_cfa_offset (4)
110 cfi_rel_offset (esi, 0)
113 orl $4, %ebx # Increase frame size if necessary to align
114 # stack for the function call
119 cfi_def_cfa_register (ebx)
129 %ebx+40 return address
140 %esp copied stack frame
148 cfi_def_cfa_register (esp)
165 cfi_adjust_cfa_offset (20)
171 cfi_adjust_cfa_offset (4)
175 call _dl_call_pltexit
181 cfi_adjust_cfa_offset (-60)
184 .size _dl_runtime_profile, .-_dl_runtime_profile