summaryrefslogtreecommitdiff
path: root/patches/glibc/2.1.3/glibc-2.1.3-allow-gcc3-dl-machine-i386.patch
blob: 2a98ac94628074ed418a2231a97feb440705b5b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
	* sysdeps/i386/dl-machine.h (RTLD_START): Don't use multi-line
	strings.
	(ELF_MACHINE_RUNTIME_TRAMPOLINE): Likewise.

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
backported a bit

--- glibc-2.1.3/sysdeps/i386/dl-machine.h.old	1999-02-20 10:19:47.000000000 -0800
+++ glibc-2.1.3/sysdeps/i386/dl-machine.h	2004-03-05 15:56:25.000000000 -0800
@@ -124,68 +124,68 @@
    and then redirect to the address it returns.  */
 #ifndef PROF
 # define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\
-	.text
-	.globl _dl_runtime_resolve
-	.type _dl_runtime_resolve, @function
-	.align 16
-_dl_runtime_resolve:
-	pushl %eax		# Preserve registers otherwise clobbered.
-	pushl %ecx
-	pushl %edx
-	movl 16(%esp), %edx	# Copy args pushed by PLT in register.  Note
-	movl 12(%esp), %eax	# that `fixup' takes its parameters in regs.
-	call fixup		# Call resolver.
-	popl %edx		# Get register content back.
-	popl %ecx
-	xchgl %eax, (%esp)	# Get %eax contents end store function address.
-	ret $8			# Jump to function address.
-	.size _dl_runtime_resolve, .-_dl_runtime_resolve
-
-	.globl _dl_runtime_profile
-	.type _dl_runtime_profile, @function
-	.align 16
-_dl_runtime_profile:
-	pushl %eax		# Preserve registers otherwise clobbered.
-	pushl %ecx
-	pushl %edx
-	movl 20(%esp), %ecx	# Load return address
-	movl 16(%esp), %edx	# Copy args pushed by PLT in register.  Note
-	movl 12(%esp), %eax	# that `fixup' takes its parameters in regs.
-	call profile_fixup	# Call resolver.
-	popl %edx		# Get register content back.
-	popl %ecx
-	xchgl %eax, (%esp)	# Get %eax contents end store function address.
-	ret $8			# Jump to function address.
-	.size _dl_runtime_profile, .-_dl_runtime_profile
-	.previous
+	.text\n\
+	.globl _dl_runtime_resolve\n\
+	.type _dl_runtime_resolve, @function\n\
+	.align 16\n\
+_dl_runtime_resolve:\n\
+	pushl %eax		# Preserve registers otherwise clobbered.\n\
+	pushl %ecx\n\
+	pushl %edx\n\
+	movl 16(%esp), %edx	# Copy args pushed by PLT in register.  Note\n\
+	movl 12(%esp), %eax	# that `fixup' takes its parameters in regs.\n\
+	call fixup		# Call resolver.\n\
+	popl %edx		# Get register content back.\n\
+	popl %ecx\n\
+	xchgl %eax, (%esp)	# Get %eax contents end store function address.\n\
+	ret $8			# Jump to function address.\n\
+	.size _dl_runtime_resolve, .-_dl_runtime_resolve\n\
+\n\
+	.globl _dl_runtime_profile\n\
+	.type _dl_runtime_profile, @function\n\
+	.align 16\n\
+_dl_runtime_profile:\n\
+	pushl %eax		# Preserve registers otherwise clobbered.\n\
+	pushl %ecx\n\
+	pushl %edx\n\
+	movl 20(%esp), %ecx	# Load return address\n\
+	movl 16(%esp), %edx	# Copy args pushed by PLT in register.  Note\n\
+	movl 12(%esp), %eax	# that `fixup' takes its parameters in regs.\n\
+	call profile_fixup	# Call resolver.\n\
+	popl %edx		# Get register content back.\n\
+	popl %ecx\n\
+	xchgl %eax, (%esp)	# Get %eax contents end store function address.\n\
+	ret $8			# Jump to function address.\n\
+	.size _dl_runtime_profile, .-_dl_runtime_profile\n\
+	.previous\n\
 ");
 #else
-# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\
-	.text
-	.globl _dl_runtime_resolve
-	.globl _dl_runtime_profile
-	.type _dl_runtime_resolve, @function
-	.type _dl_runtime_profile, @function
-	.align 16
-_dl_runtime_resolve:
-_dl_runtime_profile:
-	pushl %eax		# Preserve registers otherwise clobbered.
-	pushl %ecx
-	pushl %edx
-	movl 16(%esp), %edx	# Push the arguments for `fixup'
-	movl 12(%esp), %eax
-	pushl %edx
-	pushl %eax
-	call fixup		# Call resolver.
-	popl %edx		# Pop the parameters
-	popl %ecx
-	popl %edx		# Get register content back.
-	popl %ecx
-	xchgl %eax, (%esp)	# Get %eax contents end store function address.
-	ret $8			# Jump to function address.
-	.size _dl_runtime_resolve, .-_dl_runtime_resolve
-	.size _dl_runtime_profile, .-_dl_runtime_profile
-	.previous
+# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\n\
+	.text\n\
+	.globl _dl_runtime_resolve\n\
+	.globl _dl_runtime_profile\n\
+	.type _dl_runtime_resolve, @function\n\
+	.type _dl_runtime_profile, @function\n\
+	.align 16\n\
+_dl_runtime_resolve:\n\
+_dl_runtime_profile:\n\
+	pushl %eax		# Preserve registers otherwise clobbered.\n\
+	pushl %ecx\n\
+	pushl %edx\n\
+	movl 16(%esp), %edx	# Push the arguments for `fixup'\n\
+	movl 12(%esp), %eax\n\
+	pushl %edx\n\
+	pushl %eax\n\
+	call fixup		# Call resolver.\n\
+	popl %edx		# Pop the parameters\n\
+	popl %ecx\n\
+	popl %edx		# Get register content back.\n\
+	popl %ecx\n\
+	xchgl %eax, (%esp)	# Get %eax contents end store function address.\n\
+	ret $8			# Jump to function address.\n\
+	.size _dl_runtime_resolve, .-_dl_runtime_resolve\n\
+	.size _dl_runtime_profile, .-_dl_runtime_profile\n\
+	.previous\n\
 ");
 #endif
 
@@ -197,10 +197,10 @@
    The C function `_dl_start' is the real entry point;
    its return value is the user program's entry point.  */
 
-#define RTLD_START asm ("\
-.text\n\
-.globl _start\n\
-.globl _dl_start_user\n\
+#define RTLD_START asm ("\n\
+	.text\n\
+	.globl _start\n\
+	.globl _dl_start_user\n\
 _start:\n\
 	pushl %esp\n\
 	call _dl_start\n\
@@ -208,7 +208,7 @@
 _dl_start_user:\n\
 	# Save the user entry point address in %edi.\n\
 	movl %eax, %edi\n\
-	# Point %ebx at the GOT.
+	# Point %ebx at the GOT.\n\
 	call 0f\n\
 0:	popl %ebx\n\
 	addl $_GLOBAL_OFFSET_TABLE_+[.-0b], %ebx\n\
@@ -255,7 +255,7 @@
 	movl _dl_fini@GOT(%ebx), %edx\n\
 	# Jump to the user's entry point.\n\
 	jmp *%edi\n\
-.previous\n\
+	.previous\n\
 ");
 
 /* Nonzero iff TYPE should not be allowed to resolve to one of