yann@1
|
1 |
* sysdeps/i386/dl-machine.h (RTLD_START): Don't use multi-line
|
yann@1
|
2 |
strings.
|
yann@1
|
3 |
(ELF_MACHINE_RUNTIME_TRAMPOLINE): Likewise.
|
yann@1
|
4 |
|
yann@1
|
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
|
yann@1
|
6 |
backported a bit
|
yann@1
|
7 |
|
yann@1
|
8 |
--- glibc-2.1.3/sysdeps/i386/dl-machine.h.old 1999-02-20 10:19:47.000000000 -0800
|
yann@1
|
9 |
+++ glibc-2.1.3/sysdeps/i386/dl-machine.h 2004-03-05 15:56:25.000000000 -0800
|
yann@1
|
10 |
@@ -124,68 +124,68 @@
|
yann@1
|
11 |
and then redirect to the address it returns. */
|
yann@1
|
12 |
#ifndef PROF
|
yann@1
|
13 |
# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\
|
yann@1
|
14 |
- .text
|
yann@1
|
15 |
- .globl _dl_runtime_resolve
|
yann@1
|
16 |
- .type _dl_runtime_resolve, @function
|
yann@1
|
17 |
- .align 16
|
yann@1
|
18 |
-_dl_runtime_resolve:
|
yann@1
|
19 |
- pushl %eax # Preserve registers otherwise clobbered.
|
yann@1
|
20 |
- pushl %ecx
|
yann@1
|
21 |
- pushl %edx
|
yann@1
|
22 |
- movl 16(%esp), %edx # Copy args pushed by PLT in register. Note
|
yann@1
|
23 |
- movl 12(%esp), %eax # that `fixup' takes its parameters in regs.
|
yann@1
|
24 |
- call fixup # Call resolver.
|
yann@1
|
25 |
- popl %edx # Get register content back.
|
yann@1
|
26 |
- popl %ecx
|
yann@1
|
27 |
- xchgl %eax, (%esp) # Get %eax contents end store function address.
|
yann@1
|
28 |
- ret $8 # Jump to function address.
|
yann@1
|
29 |
- .size _dl_runtime_resolve, .-_dl_runtime_resolve
|
yann@1
|
30 |
-
|
yann@1
|
31 |
- .globl _dl_runtime_profile
|
yann@1
|
32 |
- .type _dl_runtime_profile, @function
|
yann@1
|
33 |
- .align 16
|
yann@1
|
34 |
-_dl_runtime_profile:
|
yann@1
|
35 |
- pushl %eax # Preserve registers otherwise clobbered.
|
yann@1
|
36 |
- pushl %ecx
|
yann@1
|
37 |
- pushl %edx
|
yann@1
|
38 |
- movl 20(%esp), %ecx # Load return address
|
yann@1
|
39 |
- movl 16(%esp), %edx # Copy args pushed by PLT in register. Note
|
yann@1
|
40 |
- movl 12(%esp), %eax # that `fixup' takes its parameters in regs.
|
yann@1
|
41 |
- call profile_fixup # Call resolver.
|
yann@1
|
42 |
- popl %edx # Get register content back.
|
yann@1
|
43 |
- popl %ecx
|
yann@1
|
44 |
- xchgl %eax, (%esp) # Get %eax contents end store function address.
|
yann@1
|
45 |
- ret $8 # Jump to function address.
|
yann@1
|
46 |
- .size _dl_runtime_profile, .-_dl_runtime_profile
|
yann@1
|
47 |
- .previous
|
yann@1
|
48 |
+ .text\n\
|
yann@1
|
49 |
+ .globl _dl_runtime_resolve\n\
|
yann@1
|
50 |
+ .type _dl_runtime_resolve, @function\n\
|
yann@1
|
51 |
+ .align 16\n\
|
yann@1
|
52 |
+_dl_runtime_resolve:\n\
|
yann@1
|
53 |
+ pushl %eax # Preserve registers otherwise clobbered.\n\
|
yann@1
|
54 |
+ pushl %ecx\n\
|
yann@1
|
55 |
+ pushl %edx\n\
|
yann@1
|
56 |
+ movl 16(%esp), %edx # Copy args pushed by PLT in register. Note\n\
|
yann@1
|
57 |
+ movl 12(%esp), %eax # that `fixup' takes its parameters in regs.\n\
|
yann@1
|
58 |
+ call fixup # Call resolver.\n\
|
yann@1
|
59 |
+ popl %edx # Get register content back.\n\
|
yann@1
|
60 |
+ popl %ecx\n\
|
yann@1
|
61 |
+ xchgl %eax, (%esp) # Get %eax contents end store function address.\n\
|
yann@1
|
62 |
+ ret $8 # Jump to function address.\n\
|
yann@1
|
63 |
+ .size _dl_runtime_resolve, .-_dl_runtime_resolve\n\
|
yann@1
|
64 |
+\n\
|
yann@1
|
65 |
+ .globl _dl_runtime_profile\n\
|
yann@1
|
66 |
+ .type _dl_runtime_profile, @function\n\
|
yann@1
|
67 |
+ .align 16\n\
|
yann@1
|
68 |
+_dl_runtime_profile:\n\
|
yann@1
|
69 |
+ pushl %eax # Preserve registers otherwise clobbered.\n\
|
yann@1
|
70 |
+ pushl %ecx\n\
|
yann@1
|
71 |
+ pushl %edx\n\
|
yann@1
|
72 |
+ movl 20(%esp), %ecx # Load return address\n\
|
yann@1
|
73 |
+ movl 16(%esp), %edx # Copy args pushed by PLT in register. Note\n\
|
yann@1
|
74 |
+ movl 12(%esp), %eax # that `fixup' takes its parameters in regs.\n\
|
yann@1
|
75 |
+ call profile_fixup # Call resolver.\n\
|
yann@1
|
76 |
+ popl %edx # Get register content back.\n\
|
yann@1
|
77 |
+ popl %ecx\n\
|
yann@1
|
78 |
+ xchgl %eax, (%esp) # Get %eax contents end store function address.\n\
|
yann@1
|
79 |
+ ret $8 # Jump to function address.\n\
|
yann@1
|
80 |
+ .size _dl_runtime_profile, .-_dl_runtime_profile\n\
|
yann@1
|
81 |
+ .previous\n\
|
yann@1
|
82 |
");
|
yann@1
|
83 |
#else
|
yann@1
|
84 |
-# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\
|
yann@1
|
85 |
- .text
|
yann@1
|
86 |
- .globl _dl_runtime_resolve
|
yann@1
|
87 |
- .globl _dl_runtime_profile
|
yann@1
|
88 |
- .type _dl_runtime_resolve, @function
|
yann@1
|
89 |
- .type _dl_runtime_profile, @function
|
yann@1
|
90 |
- .align 16
|
yann@1
|
91 |
-_dl_runtime_resolve:
|
yann@1
|
92 |
-_dl_runtime_profile:
|
yann@1
|
93 |
- pushl %eax # Preserve registers otherwise clobbered.
|
yann@1
|
94 |
- pushl %ecx
|
yann@1
|
95 |
- pushl %edx
|
yann@1
|
96 |
- movl 16(%esp), %edx # Push the arguments for `fixup'
|
yann@1
|
97 |
- movl 12(%esp), %eax
|
yann@1
|
98 |
- pushl %edx
|
yann@1
|
99 |
- pushl %eax
|
yann@1
|
100 |
- call fixup # Call resolver.
|
yann@1
|
101 |
- popl %edx # Pop the parameters
|
yann@1
|
102 |
- popl %ecx
|
yann@1
|
103 |
- popl %edx # Get register content back.
|
yann@1
|
104 |
- popl %ecx
|
yann@1
|
105 |
- xchgl %eax, (%esp) # Get %eax contents end store function address.
|
yann@1
|
106 |
- ret $8 # Jump to function address.
|
yann@1
|
107 |
- .size _dl_runtime_resolve, .-_dl_runtime_resolve
|
yann@1
|
108 |
- .size _dl_runtime_profile, .-_dl_runtime_profile
|
yann@1
|
109 |
- .previous
|
yann@1
|
110 |
+# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\n\
|
yann@1
|
111 |
+ .text\n\
|
yann@1
|
112 |
+ .globl _dl_runtime_resolve\n\
|
yann@1
|
113 |
+ .globl _dl_runtime_profile\n\
|
yann@1
|
114 |
+ .type _dl_runtime_resolve, @function\n\
|
yann@1
|
115 |
+ .type _dl_runtime_profile, @function\n\
|
yann@1
|
116 |
+ .align 16\n\
|
yann@1
|
117 |
+_dl_runtime_resolve:\n\
|
yann@1
|
118 |
+_dl_runtime_profile:\n\
|
yann@1
|
119 |
+ pushl %eax # Preserve registers otherwise clobbered.\n\
|
yann@1
|
120 |
+ pushl %ecx\n\
|
yann@1
|
121 |
+ pushl %edx\n\
|
yann@1
|
122 |
+ movl 16(%esp), %edx # Push the arguments for `fixup'\n\
|
yann@1
|
123 |
+ movl 12(%esp), %eax\n\
|
yann@1
|
124 |
+ pushl %edx\n\
|
yann@1
|
125 |
+ pushl %eax\n\
|
yann@1
|
126 |
+ call fixup # Call resolver.\n\
|
yann@1
|
127 |
+ popl %edx # Pop the parameters\n\
|
yann@1
|
128 |
+ popl %ecx\n\
|
yann@1
|
129 |
+ popl %edx # Get register content back.\n\
|
yann@1
|
130 |
+ popl %ecx\n\
|
yann@1
|
131 |
+ xchgl %eax, (%esp) # Get %eax contents end store function address.\n\
|
yann@1
|
132 |
+ ret $8 # Jump to function address.\n\
|
yann@1
|
133 |
+ .size _dl_runtime_resolve, .-_dl_runtime_resolve\n\
|
yann@1
|
134 |
+ .size _dl_runtime_profile, .-_dl_runtime_profile\n\
|
yann@1
|
135 |
+ .previous\n\
|
yann@1
|
136 |
");
|
yann@1
|
137 |
#endif
|
yann@1
|
138 |
|
yann@1
|
139 |
@@ -197,10 +197,10 @@
|
yann@1
|
140 |
The C function `_dl_start' is the real entry point;
|
yann@1
|
141 |
its return value is the user program's entry point. */
|
yann@1
|
142 |
|
yann@1
|
143 |
-#define RTLD_START asm ("\
|
yann@1
|
144 |
-.text\n\
|
yann@1
|
145 |
-.globl _start\n\
|
yann@1
|
146 |
-.globl _dl_start_user\n\
|
yann@1
|
147 |
+#define RTLD_START asm ("\n\
|
yann@1
|
148 |
+ .text\n\
|
yann@1
|
149 |
+ .globl _start\n\
|
yann@1
|
150 |
+ .globl _dl_start_user\n\
|
yann@1
|
151 |
_start:\n\
|
yann@1
|
152 |
pushl %esp\n\
|
yann@1
|
153 |
call _dl_start\n\
|
yann@1
|
154 |
@@ -208,7 +208,7 @@
|
yann@1
|
155 |
_dl_start_user:\n\
|
yann@1
|
156 |
# Save the user entry point address in %edi.\n\
|
yann@1
|
157 |
movl %eax, %edi\n\
|
yann@1
|
158 |
- # Point %ebx at the GOT.
|
yann@1
|
159 |
+ # Point %ebx at the GOT.\n\
|
yann@1
|
160 |
call 0f\n\
|
yann@1
|
161 |
0: popl %ebx\n\
|
yann@1
|
162 |
addl $_GLOBAL_OFFSET_TABLE_+[.-0b], %ebx\n\
|
yann@1
|
163 |
@@ -255,7 +255,7 @@
|
yann@1
|
164 |
movl _dl_fini@GOT(%ebx), %edx\n\
|
yann@1
|
165 |
# Jump to the user's entry point.\n\
|
yann@1
|
166 |
jmp *%edi\n\
|
yann@1
|
167 |
-.previous\n\
|
yann@1
|
168 |
+ .previous\n\
|
yann@1
|
169 |
");
|
yann@1
|
170 |
|
yann@1
|
171 |
/* Nonzero iff TYPE should not be allowed to resolve to one of
|