1 /* PLT trampolines. i386 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
28 cfi_adjust_cfa_offset (8)
29 pushl %eax # Preserve registers otherwise clobbered.
30 cfi_adjust_cfa_offset (4)
32 cfi_adjust_cfa_offset (4)
34 cfi_adjust_cfa_offset (4)
35 movl 16(%esp), %edx # Copy args pushed by PLT in register. Note
36 movl 12(%esp), %eax # that `fixup' takes its parameters in regs.
37 call _dl_fixup # Call resolver.
38 popl %edx # Get register content back.
39 cfi_adjust_cfa_offset (-4)
41 movl %eax, (%esp) # Store the function address.
43 ret $12 # Jump to function address.
45 .size _dl_runtime_resolve, .-_dl_runtime_resolve
49 .globl _dl_runtime_profile
50 .type _dl_runtime_profile, @function
54 cfi_adjust_cfa_offset (8)
56 cfi_adjust_cfa_offset (4)
57 addl $8, (%esp) # Account for the pushed PLT data
59 cfi_adjust_cfa_offset (4)
60 pushl %eax # Preserve registers otherwise clobbered.
61 cfi_adjust_cfa_offset (4)
63 cfi_adjust_cfa_offset (4)
65 cfi_adjust_cfa_offset (4)
68 cfi_adjust_cfa_offset (8)
72 pushl %ecx # Address of the register structure
73 cfi_adjust_cfa_offset (4)
74 movl 40(%esp), %ecx # Load return address
75 movl 36(%esp), %edx # Copy args pushed by PLT in register. Note
76 movl 32(%esp), %eax # that `fixup' takes its parameters in regs.
77 call _dl_profile_fixup # Call resolver.
78 cfi_adjust_cfa_offset (-8)
83 cfi_adjust_cfa_offset (-4)
84 popl %edx # Get register content back.
85 cfi_adjust_cfa_offset (-4)
87 movl %eax, (%esp) # Store the function address.
89 ret $20 # Jump to function address.
102 cfi_adjust_cfa_offset (12)
104 cfi_rel_offset (ebx, 0)
105 movl %edx, %ebx # This is the frame buffer size
107 cfi_adjust_cfa_offset (4)
108 cfi_rel_offset (edi, 0)
110 cfi_adjust_cfa_offset (4)
111 cfi_rel_offset (esi, 0)
114 orl $4, %ebx # Increase frame size if necessary to align
115 # stack for the function call
120 cfi_def_cfa_register (ebx)
130 %ebx+40 return address
141 %esp copied stack frame
149 cfi_def_cfa_register (esp)
166 cfi_adjust_cfa_offset (20)
172 cfi_adjust_cfa_offset (4)
176 call _dl_call_pltexit
182 cfi_adjust_cfa_offset (-60)
185 .size _dl_runtime_profile, .-_dl_runtime_profile