]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/gcc-2.95.3-alpha.patch
git-svn-id: http://svn.ipfire.org/svn/ipfire/IPFire/source@16 ea5c0bd1-69bd-2848...
[people/pmueller/ipfire-2.x.git] / src / patches / gcc-2.95.3-alpha.patch
1 diff -ur gcc-2.95.3.old/gcc/config/alpha/crtbegin.asm gcc-2.95.3/gcc/config/alpha/crtbegin.asm
2 --- gcc-2.95.3.old/gcc/config/alpha/crtbegin.asm 2004-02-02 12:13:24.000000000 +0000
3 +++ gcc-2.95.3/gcc/config/alpha/crtbegin.asm 2004-02-02 12:16:37.000000000 +0000
4 @@ -1,42 +1,46 @@
5 - # Copyright (C) 1996, 1998 Free Software Foundation, Inc.
6 - # Contributed by Richard Henderson (rth@tamu.edu)
7 - #
8 - # This file is free software; you can redistribute it and/or modify it
9 - # under the terms of the GNU General Public License as published by the
10 - # Free Software Foundation; either version 2, or (at your option) any
11 - # later version.
12 - #
13 - # In addition to the permissions in the GNU General Public License, the
14 - # Free Software Foundation gives you unlimited permission to link the
15 - # compiled version of this file with other programs, and to distribute
16 - # those programs without any restriction coming from the use of this
17 - # file. (The General Public License restrictions do apply in other
18 - # respects; for example, they cover modification of the file, and
19 - # distribution when not linked into another program.)
20 - #
21 - # This file is distributed in the hope that it will be useful, but
22 - # WITHOUT ANY WARRANTY; without even the implied warranty of
23 - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 - # General Public License for more details.
25 - #
26 - # You should have received a copy of the GNU General Public License
27 - # along with this program; see the file COPYING. If not, write to
28 - # the Free Software Foundation, 59 Temple Place - Suite 330,
29 - # Boston, MA 02111-1307, USA.
30 - #
31 - # As a special exception, if you link this library with files
32 - # compiled with GCC to produce an executable, this does not cause
33 - # the resulting executable to be covered by the GNU General Public License.
34 - # This exception does not however invalidate any other reasons why
35 - # the executable file might be covered by the GNU General Public License.
36 -
37 - #
38 - # Heads of the constructor/destructor lists.
39 - #
40 -
41 - # The __*TOR_LIST__ symbols are not global because when this file is used
42 - # in a shared library, we do not want the symbol to fall over to the
43 - # application's lists.
44 +/* Copyright (C) 1996, 1998 Free Software Foundation, Inc.
45 + * Contributed by Richard Henderson (rth@tamu.edu)
46 + *
47 + * This file is free software; you can redistribute it and/or modify it
48 + * under the terms of the GNU General Public License as published by the
49 + * Free Software Foundation; either version 2, or (at your option) any
50 + * later version.
51 + *
52 + * In addition to the permissions in the GNU General Public License, the
53 + * Free Software Foundation gives you unlimited permission to link the
54 + * compiled version of this file with other programs, and to distribute
55 + * those programs without any restriction coming from the use of this
56 + * file. (The General Public License restrictions do apply in other
57 + * respects; for example, they cover modification of the file, and
58 + * distribution when not linked into another program.)
59 + *
60 + * This file is distributed in the hope that it will be useful, but
61 + * WITHOUT ANY WARRANTY; without even the implied warranty of
62 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
63 + * General Public License for more details.
64 + *
65 + * You should have received a copy of the GNU General Public License
66 + * along with this program; see the file COPYING. If not, write to
67 + * the Free Software Foundation, 59 Temple Place - Suite 330,
68 + * Boston, MA 02111-1307, USA.
69 + *
70 + * As a special exception, if you link this library with files
71 + * compiled with GCC to produce an executable, this does not cause
72 + * the resulting executable to be covered by the GNU General Public License.
73 + * This exception does not however invalidate any other reasons why
74 + * the executable file might be covered by the GNU General Public License.
75 + */
76 +
77 +#include "auto-host.h"
78 +
79 +/*
80 + * Heads of the constructor/destructor lists.
81 + */
82 +
83 +/* The __*TOR_LIST__ symbols are not global because when this file is used
84 + * in a shared library, we do not want the symbol to fall over to the
85 + * application's lists.
86 + */
87
88 .section .ctors,"aw"
89
90 @@ -53,34 +57,34 @@
91 .section .eh_frame,"aw"
92 __EH_FRAME_BEGIN__:
93
94 - #
95 - # Fragment of the ELF _fini routine that invokes our dtor cleanup.
96 - #
97 +/*
98 + * Fragment of the ELF _fini routine that invokes our dtor cleanup.
99 + */
100
101 .section .fini,"ax"
102
103 - # Since the bits of the _fini function are spread across many
104 - # object files, each potentially with its own GP, we must
105 - # assume we need to load ours. Further, our .fini section
106 - # can easily be more than 4MB away from our .text bits so we
107 - # can't use bsr.
108 + /* Since the bits of the _fini function are spread across many
109 + object files, each potentially with its own GP, we must
110 + assume we need to load ours. Further, our .fini section
111 + can easily be more than 4MB away from our .text bits so we
112 + can't use bsr. */
113
114 br $29,1f
115 1: ldgp $29,0($29)
116 jsr $26,__do_global_dtors_aux
117
118 - # Ideally this call would go in crtend.o, except that we can't
119 - # get hold of __EH_FRAME_BEGIN__ there.
120 + /* Ideally this call would go in crtend.o, except that we can't
121 + get hold of __EH_FRAME_BEGIN__ there */
122
123 jsr $26,__do_frame_takedown
124
125 - # Must match the alignment we got from crti.o else we get
126 - # zero-filled holes in our _fini function and then SIGILL.
127 + /* Must match the alignment we got from crti.o else we get
128 + zero-filled holes in our _fini function and then SIGILL. */
129 .align 3
130
131 - #
132 - # Fragment of the ELF _init routine that sets up the frame info.
133 - #
134 +/*
135 + * Fragment of the ELF _init routine that sets up the frame info.
136 + */
137
138 .section .init,"ax"
139 br $29,1f
140 @@ -88,13 +92,13 @@
141 jsr $26,__do_frame_setup
142 .align 3
143
144 - #
145 - # Invoke our destructors in order.
146 - #
147 +/*
148 + * Invoke our destructors in order.
149 + */
150
151 .data
152
153 - # Support recursive calls to exit.
154 +/* Support recursive calls to exit. */
155 $ptr: .quad __DTOR_LIST__
156
157 /* A globally unique widget for c++ local destructors to hang off.
158 @@ -128,17 +132,28 @@
159 .ent __do_global_dtors_aux
160
161 __do_global_dtors_aux:
162 + ldgp $29,0($27)
163 lda $30,-16($30)
164 .frame $30,16,$26,0
165 stq $9,8($30)
166 stq $26,0($30)
167 .mask 0x4000200,-16
168 - .prologue 0
169 + .prologue 1
170
171 +#ifdef SHARED
172 + /* Do c++ local destructors. */
173 + lda $1,__cxa_finalize
174 + beq $1,2f
175 + lda $16,__dso_handle
176 + jsr $26,__cxa_finalize
177 + ldgp $29,0($26)
178 +2:
179 +#endif
180 lda $9,$ptr
181 br 1f
182 0: stq $1,0($9)
183 jsr $26,($27)
184 + ldgp $29,0($26)
185 1: ldq $1,0($9)
186 ldq $27,8($1)
187 addq $1,8,$1
188 @@ -151,11 +166,11 @@
189
190 .end __do_global_dtors_aux
191
192 - #
193 - # Install our frame info.
194 - #
195 +/*
196 + * Install our frame info.
197 + */
198
199 - # ??? How can we rationally keep this size correct?
200 +/* ??? How can we rationally keep this size correct? */
201
202 .section .bss
203 .type $object,@object
204 @@ -188,9 +203,9 @@
205
206 .end __do_frame_setup
207
208 - #
209 - # Remove our frame info.
210 - #
211 +/*
212 + * Remove our frame info.
213 + */
214
215 .align 3
216 .ent __do_frame_takedown
217 @@ -215,3 +230,6 @@
218
219 .weak __register_frame_info
220 .weak __deregister_frame_info
221 +#ifdef SHARED
222 +.weak __cxa_finalize
223 +#endif
224 diff -ur gcc-2.95.3.old/gcc/config/alpha/elf.h gcc-2.95.3/gcc/config/alpha/elf.h
225 --- gcc-2.95.3.old/gcc/config/alpha/elf.h 1999-06-21 21:15:10.000000000 +0100
226 +++ gcc-2.95.3/gcc/config/alpha/elf.h 2004-02-02 12:16:37.000000000 +0000
227 @@ -513,7 +513,7 @@
228 #define STARTFILE_SPEC \
229 "%{!shared: \
230 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\
231 - crti.o%s crtbegin.o%s"
232 + crti.o%s %{shared:crtbeginS.o%s}%{!shared:crtbegin.o%s}"
233
234 /* Provide a ENDFILE_SPEC appropriate for ELF. Here we tack on the
235 magical crtend.o file which provides part of the support for
236 @@ -522,7 +522,7 @@
237
238 #undef ENDFILE_SPEC
239 #define ENDFILE_SPEC \
240 - "crtend.o%s crtn.o%s"
241 + "%{shared:crtendS.o%s}%{!shared:crtend.o%s} crtn.o%s"
242
243 /* We support #pragma. */
244 #define HANDLE_SYSV_PRAGMA
245 diff -ur gcc-2.95.3.old/gcc/config/alpha/t-crtbe gcc-2.95.3/gcc/config/alpha/t-crtbe
246 --- gcc-2.95.3.old/gcc/config/alpha/t-crtbe 1998-12-16 21:01:05.000000000 +0000
247 +++ gcc-2.95.3/gcc/config/alpha/t-crtbe 2004-02-02 12:16:37.000000000 +0000
248 @@ -3,7 +3,13 @@
249
250 # Assemble startup files.
251 crtbegin.o: $(srcdir)/config/alpha/crtbegin.asm $(GCC_PASSES)
252 - $(GCC_FOR_TARGET) -c -o crtbegin.o -x assembler $(srcdir)/config/alpha/crtbegin.asm
253 + $(GCC_FOR_TARGET) -c -o crtbegin.o -x assembler-with-cpp -I. $(srcdir)/config/alpha/crtbegin.asm
254
255 crtend.o: $(srcdir)/config/alpha/crtend.asm $(GCC_PASSES)
256 $(GCC_FOR_TARGET) -c -o crtend.o -x assembler $(srcdir)/config/alpha/crtend.asm
257 +
258 +crtbeginS.o: $(srcdir)/config/alpha/crtbegin.asm $(GCC_PASSES)
259 + $(GCC_FOR_TARGET) -DSHARED -c -o crtbeginS.o -x assembler-with-cpp -I. $(srcdir)/config/alpha/crtbegin.asm
260 +
261 +crtendS.o: $(srcdir)/config/alpha/crtend.asm $(GCC_PASSES)
262 + $(GCC_FOR_TARGET) -c -o crtendS.o -x assembler -I. $(srcdir)/config/alpha/crtend.asm
263 diff -ur gcc-2.95.3.old/gcc/configure.in gcc-2.95.3/gcc/configure.in
264 --- gcc-2.95.3.old/gcc/configure.in 2004-02-02 12:13:24.000000000 +0000
265 +++ gcc-2.95.3/gcc/configure.in 2004-02-02 12:16:37.000000000 +0000
266 @@ -607,7 +607,7 @@
267 tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h"
268 target_cpu_default="MASK_GAS"
269 tmake_file="t-linux t-linux-gnulibc1 alpha/t-linux alpha/t-crtbe alpha/t-ieee"
270 - extra_parts="crtbegin.o crtend.o"
271 + extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
272 xmake_file=none
273 gas=yes gnu_ld=yes
274 if test x$enable_threads = xyes; then
275 @@ -618,7 +618,7 @@
276 tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h"
277 target_cpu_default="MASK_GAS"
278 tmake_file="t-linux alpha/t-linux alpha/t-crtbe alpha/t-ieee"
279 - extra_parts="crtbegin.o crtend.o"
280 + extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
281 xmake_file=none
282 gas=yes gnu_ld=yes
283 if test x$enable_threads = xyes; then
284 @@ -629,7 +629,7 @@
285 tm_file="${tm_file} alpha/elf.h alpha/netbsd.h alpha/netbsd-elf.h"
286 target_cpu_default="MASK_GAS"
287 tmake_file="alpha/t-crtbe alpha/t-ieee"
288 - extra_parts="crtbegin.o crtend.o"
289 + extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
290 xmake_file=none
291 gas=yes gnu_ld=yes
292 ;;
293 --- gcc-2.95.3.old/gcc/configure 2004-02-02 12:13:24.000000000 +0000
294 +++ gcc-2.95.3/gcc/configure 2004-02-02 14:20:41.000000000 +0000
295 @@ -3041,7 +3041,7 @@
296 tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h"
297 target_cpu_default="MASK_GAS"
298 tmake_file="t-linux t-linux-gnulibc1 alpha/t-linux alpha/t-crtbe alpha/t-ieee"
299 - extra_parts="crtbegin.o crtend.o"
300 + extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
301 xmake_file=none
302 gas=yes gnu_ld=yes
303 if test x$enable_threads = xyes; then
304 @@ -3052,7 +3052,7 @@
305 tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h"
306 target_cpu_default="MASK_GAS"
307 tmake_file="t-linux alpha/t-linux alpha/t-crtbe alpha/t-ieee"
308 - extra_parts="crtbegin.o crtend.o"
309 + extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
310 xmake_file=none
311 gas=yes gnu_ld=yes
312 if test x$enable_threads = xyes; then
313 @@ -3063,7 +3063,7 @@
314 tm_file="${tm_file} alpha/elf.h alpha/netbsd.h alpha/netbsd-elf.h"
315 target_cpu_default="MASK_GAS"
316 tmake_file="alpha/t-crtbe alpha/t-ieee"
317 - extra_parts="crtbegin.o crtend.o"
318 + extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
319 xmake_file=none
320 gas=yes gnu_ld=yes
321 ;;