Patches for glibc-2.5, courtesy of "Robert P. J. Day" <rpjday@mindspring.com>
1 * sysdeps/i386/dl-machine.h (RTLD_START): Don't use multi-line
3 (ELF_MACHINE_RUNTIME_TRAMPOLINE): Likewise.
5 http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/i386/dl-machine.h.diff?r1=1.82&r2=1.83&cvsroot=glibc&hideattic=0
8 --- glibc-2.1.3/sysdeps/i386/dl-machine.h.old 1999-02-20 10:19:47.000000000 -0800
9 +++ glibc-2.1.3/sysdeps/i386/dl-machine.h 2004-03-05 15:56:25.000000000 -0800
11 and then redirect to the address it returns. */
13 # define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\
15 - .globl _dl_runtime_resolve
16 - .type _dl_runtime_resolve, @function
19 - pushl %eax # Preserve registers otherwise clobbered.
22 - movl 16(%esp), %edx # Copy args pushed by PLT in register. Note
23 - movl 12(%esp), %eax # that `fixup' takes its parameters in regs.
24 - call fixup # Call resolver.
25 - popl %edx # Get register content back.
27 - xchgl %eax, (%esp) # Get %eax contents end store function address.
28 - ret $8 # Jump to function address.
29 - .size _dl_runtime_resolve, .-_dl_runtime_resolve
31 - .globl _dl_runtime_profile
32 - .type _dl_runtime_profile, @function
35 - pushl %eax # Preserve registers otherwise clobbered.
38 - movl 20(%esp), %ecx # Load return address
39 - movl 16(%esp), %edx # Copy args pushed by PLT in register. Note
40 - movl 12(%esp), %eax # that `fixup' takes its parameters in regs.
41 - call profile_fixup # Call resolver.
42 - popl %edx # Get register content back.
44 - xchgl %eax, (%esp) # Get %eax contents end store function address.
45 - ret $8 # Jump to function address.
46 - .size _dl_runtime_profile, .-_dl_runtime_profile
49 + .globl _dl_runtime_resolve\n\
50 + .type _dl_runtime_resolve, @function\n\
52 +_dl_runtime_resolve:\n\
53 + pushl %eax # Preserve registers otherwise clobbered.\n\
56 + movl 16(%esp), %edx # Copy args pushed by PLT in register. Note\n\
57 + movl 12(%esp), %eax # that `fixup' takes its parameters in regs.\n\
58 + call fixup # Call resolver.\n\
59 + popl %edx # Get register content back.\n\
61 + xchgl %eax, (%esp) # Get %eax contents end store function address.\n\
62 + ret $8 # Jump to function address.\n\
63 + .size _dl_runtime_resolve, .-_dl_runtime_resolve\n\
65 + .globl _dl_runtime_profile\n\
66 + .type _dl_runtime_profile, @function\n\
68 +_dl_runtime_profile:\n\
69 + pushl %eax # Preserve registers otherwise clobbered.\n\
72 + movl 20(%esp), %ecx # Load return address\n\
73 + movl 16(%esp), %edx # Copy args pushed by PLT in register. Note\n\
74 + movl 12(%esp), %eax # that `fixup' takes its parameters in regs.\n\
75 + call profile_fixup # Call resolver.\n\
76 + popl %edx # Get register content back.\n\
78 + xchgl %eax, (%esp) # Get %eax contents end store function address.\n\
79 + ret $8 # Jump to function address.\n\
80 + .size _dl_runtime_profile, .-_dl_runtime_profile\n\
84 -# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\
86 - .globl _dl_runtime_resolve
87 - .globl _dl_runtime_profile
88 - .type _dl_runtime_resolve, @function
89 - .type _dl_runtime_profile, @function
93 - pushl %eax # Preserve registers otherwise clobbered.
96 - movl 16(%esp), %edx # Push the arguments for `fixup'
100 - call fixup # Call resolver.
101 - popl %edx # Pop the parameters
103 - popl %edx # Get register content back.
105 - xchgl %eax, (%esp) # Get %eax contents end store function address.
106 - ret $8 # Jump to function address.
107 - .size _dl_runtime_resolve, .-_dl_runtime_resolve
108 - .size _dl_runtime_profile, .-_dl_runtime_profile
110 +# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\n\
112 + .globl _dl_runtime_resolve\n\
113 + .globl _dl_runtime_profile\n\
114 + .type _dl_runtime_resolve, @function\n\
115 + .type _dl_runtime_profile, @function\n\
117 +_dl_runtime_resolve:\n\
118 +_dl_runtime_profile:\n\
119 + pushl %eax # Preserve registers otherwise clobbered.\n\
122 + movl 16(%esp), %edx # Push the arguments for `fixup'\n\
123 + movl 12(%esp), %eax\n\
126 + call fixup # Call resolver.\n\
127 + popl %edx # Pop the parameters\n\
129 + popl %edx # Get register content back.\n\
131 + xchgl %eax, (%esp) # Get %eax contents end store function address.\n\
132 + ret $8 # Jump to function address.\n\
133 + .size _dl_runtime_resolve, .-_dl_runtime_resolve\n\
134 + .size _dl_runtime_profile, .-_dl_runtime_profile\n\
139 @@ -197,10 +197,10 @@
140 The C function `_dl_start' is the real entry point;
141 its return value is the user program's entry point. */
143 -#define RTLD_START asm ("\
146 -.globl _dl_start_user\n\
147 +#define RTLD_START asm ("\n\
150 + .globl _dl_start_user\n\
156 # Save the user entry point address in %edi.\n\
158 - # Point %ebx at the GOT.
159 + # Point %ebx at the GOT.\n\
162 addl $_GLOBAL_OFFSET_TABLE_+[.-0b], %ebx\n\
164 movl _dl_fini@GOT(%ebx), %edx\n\
165 # Jump to the user's entry point.\n\
171 /* Nonzero iff TYPE should not be allowed to resolve to one of