summaryrefslogtreecommitdiff
path: root/cross/COMMON/patches-binutils/patch-sh
blob: 4f166a9347eda0e5aae43eda749a0ec79b039359 (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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
$NetBSD: patch-sh,v 1.1 2001/01/04 01:19:29 itojun Exp $

ftp://ftp.netbsd.org/pub/NetBSD/arch/sh3/crosskit/

diff -u -r -N -x *.orig -x CVS old/bfd/Makefile.am binutils-2.9.1/bfd/Makefile.am
--- bfd/Makefile.am	Wed Jan  3 20:40:59 2001
+++ bfd/Makefile.am	Wed Jan  3 20:44:17 2001
@@ -153,6 +153,7 @@
 	elf-m10200.lo \
 	elf-m10300.lo \
 	elf32-ppc.lo \
+	elf32-shunx.lo \
 	elf32-sh.lo \
 	elf32-sparc.lo \
 	elf32-v850.lo \
@@ -260,6 +261,7 @@
 	elf-m10200.c \
 	elf-m10300.c \
 	elf32-ppc.c \
+	elf32-shunx.c \
 	elf32-sh.c \
 	elf32-sparc.c \
 	elf32-v850.c \
@@ -797,6 +799,9 @@
 elf32-ppc.lo: elf32-ppc.c $(INCDIR)/bfdlink.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/elf/ppc.h elf32-target.h
+elf32-shunx.lo: elf32-shunx.c $(INCDIR)/bfdlink.h elf-bfd.h \
+  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+  elf32-target.h
 elf32-sh.lo: elf32-sh.c $(INCDIR)/bfdlink.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   elf32-target.h
diff -u -r -N -x *.orig -x CVS old/bfd/Makefile.in binutils-2.9.1/bfd/Makefile.in
--- bfd/Makefile.in	Wed Jan  3 20:40:59 2001
+++ bfd/Makefile.in	Wed Jan  3 20:44:04 2001
@@ -242,6 +242,7 @@
 	elf-m10200.lo \
 	elf-m10300.lo \
 	elf32-ppc.lo \
+	elf32-shunx.lo \
 	elf32-sh.lo \
 	elf32-sparc.lo \
 	elf32-v850.lo \
@@ -349,6 +350,7 @@
 	elf-m10200.c \
 	elf-m10300.c \
 	elf32-ppc.c \
+	elf32-shunx.c \
 	elf32-sh.c \
 	elf32-sparc.c \
 	elf32-v850.c \
@@ -1254,6 +1256,9 @@
 elf32-ppc.lo: elf32-ppc.c $(INCDIR)/bfdlink.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/elf/ppc.h elf32-target.h
+elf32-shunx.lo: elf32-shunx.c $(INCDIR)/bfdlink.h elf-bfd.h \
+  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+  elf32-target.h
 elf32-sh.lo: elf32-sh.c $(INCDIR)/bfdlink.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   elf32-target.h
diff -u -r -N -x *.orig -x CVS old/bfd/config.bfd binutils-2.9.1/bfd/config.bfd
--- bfd/config.bfd	Wed Jan  3 20:55:42 2001
+++ bfd/config.bfd	Wed Jan  3 20:46:00 2001
@@ -40,6 +40,7 @@
 powerpc*) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
 rs6000)	targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
 sparc*)	targ_archs=bfd_sparc_arch ;;
+sh*)	targ_archs=bfd_sh_arch ;;
 v850*)	targ_archs=bfd_v850_arch ;;
 z8k*)	targ_archs=bfd_z8k_arch ;;
 *)	targ_archs=bfd_${targ_cpu}_arch ;;
@@ -494,14 +495,34 @@
     targ_defvec=rs6000coff_vec
     ;;
 
+  sh-*-netbsdelf)
+    targ_defvec=bfd_elf32_shunx_vec
+    targ_selvecs="bfd_elf32_shlunx_vec shcoff_vec shlcoff_vec "
+    targ_underscore=yes
+    ;;
+  shel-*-netbsdelf)
+    targ_defvec=bfd_elf32_shlunx_vec
+    targ_selvecs="bfd_elf32_shunx_vec shcoff_vec shlcoff_vec "
+    targ_underscore=yes
+    ;;
   sh-*-elf*)
     targ_defvec=bfd_elf32_sh_vec
-    targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
+    targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec "
+    targ_underscore=yes
+    ;;
+  sh-*-netbsdcoff)
+    targ_defvec=shcoff_vec
+    targ_selvecs="shlcoff_vec "
+    targ_underscore=yes
+    ;;
+  shel-*-netbsdcoff)
+    targ_defvec=shlcoff_vec
+    targ_selvecs="shcoff_vec "
     targ_underscore=yes
     ;;
   sh-*-* | sh-*-rtems*)
     targ_defvec=shcoff_vec
-    targ_selvecs="shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
+    targ_selvecs="shlcoff_vec "
     targ_underscore=yes
     ;;
 
diff -u -r -N -x *.orig -x CVS old/bfd/configure binutils-2.9.1/bfd/configure
--- bfd/configure	Wed Jan  3 20:40:59 2001
+++ bfd/configure	Wed Jan  3 20:46:23 2001
@@ -2738,6 +2738,8 @@
     bfd_elf32_mn10300_vec)	tb="$tb elf-m10300.lo elf32.lo $elf" ;;
     bfd_elf32_powerpc_vec)	tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
     bfd_elf32_powerpcle_vec)	tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
+    bfd_elf32_shunx_vec)	tb="$tb elf32-shunx.lo elf32.lo $elf coff-sh.lo" ;;
+    bfd_elf32_shlunx_vec)	tb="$tb elf32-shunx.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_sh_vec)		tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_shl_vec)		tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_sparc_vec)	tb="$tb elf32-sparc.lo elf32.lo $elf" ;;
diff -u -r -N -x *.orig -x CVS old/bfd/configure.in binutils-2.9.1/bfd/configure.in
--- bfd/configure.in	Wed Jan  3 20:40:59 2001
+++ bfd/configure.in	Wed Jan  3 20:46:30 2001
@@ -423,6 +423,8 @@
     bfd_elf32_mn10300_vec)	tb="$tb elf-m10300.lo elf32.lo $elf" ;;
     bfd_elf32_powerpc_vec)	tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
     bfd_elf32_powerpcle_vec)	tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
+    bfd_elf32_shunx_vec)	tb="$tb elf32-shunx.lo elf32.lo $elf coff-sh.lo" ;;
+    bfd_elf32_shlunx_vec)	tb="$tb elf32-shunx.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_sh_vec)		tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_shl_vec)		tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_sparc_vec)	tb="$tb elf32-sparc.lo elf32.lo $elf" ;;
diff -u -r -N -x *.orig -x CVS old/bfd/elf32-sh.c binutils-2.9.1/bfd/elf32-sh.c
--- bfd/elf32-sh.c	Sat May  2 00:48:09 1998
+++ bfd/elf32-sh.c	Wed Jan  3 20:47:15 2001
@@ -1889,13 +1889,28 @@
   return NULL;
 }
 
+#ifndef TARGET_BIG_SYM
 #define TARGET_BIG_SYM		bfd_elf32_sh_vec
+#endif
+
+#ifndef TARGET_BIG_NAME
 #define TARGET_BIG_NAME		"elf32-sh"
+#endif
+
+#ifndef TARGET_LITTLE_SYM
 #define TARGET_LITTLE_SYM	bfd_elf32_shl_vec
+#endif
+
+#ifndef TARGET_LITTLE_NAME
 #define TARGET_LITTLE_NAME	"elf32-shl"
+#endif
+
 #define ELF_ARCH		bfd_arch_sh
 #define ELF_MACHINE_CODE	EM_SH
+
+#ifndef ELF_MAXPAGESIZE
 #define ELF_MAXPAGESIZE		0x1
+#endif
 
 #define elf_symbol_leading_char '_'
 
diff -u -r -N -x *.orig -x CVS old/bfd/elf32-shunx.c binutils-2.9.1/bfd/elf32-shunx.c
--- bfd/elf32-shunx.c	Thu Jan  1 09:00:00 1970
+++ bfd/elf32-shunx.c	Wed Jan  3 20:47:30 2001
@@ -0,0 +1,7 @@
+#define TARGET_BIG_SYM                bfd_elf32_shunx_vec
+#define TARGET_BIG_NAME               "elf32-sh-unx"
+#define TARGET_LITTLE_SYM     bfd_elf32_shlunx_vec
+#define TARGET_LITTLE_NAME    "elf32-shl-unx"
+#define ELF_MAXPAGESIZE               0x1000
+
+#include "elf32-sh.c"
diff -u -r -N -x *.orig -x CVS old/bfd/targets.c binutils-2.9.1/bfd/targets.c
--- bfd/targets.c	Wed Jan  3 20:40:59 2001
+++ bfd/targets.c	Wed Jan  3 20:47:40 2001
@@ -504,6 +504,8 @@
 extern const bfd_target bfd_elf32_mn10300_vec;
 extern const bfd_target bfd_elf32_powerpc_vec;
 extern const bfd_target bfd_elf32_powerpcle_vec;
+extern const bfd_target bfd_elf32_shunx_vec;
+extern const bfd_target bfd_elf32_shlunx_vec;
 extern const bfd_target bfd_elf32_sh_vec;
 extern const bfd_target bfd_elf32_shl_vec;
 extern const bfd_target bfd_elf32_sparc_vec;
diff -u -r -N -x *.orig -x CVS old/config.sub binutils-2.9.1/config.sub
--- config.sub	Wed Jan  3 20:41:00 2001
+++ config.sub	Wed Jan  3 20:47:56 2001
@@ -175,7 +175,7 @@
 		| arme[lb] | pyramid | mn10200 | mn10300 \
 		| tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
 		| alpha | alphaev5 | alphaev56 | alphapca56 | alphaev6 \
-		| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
+		| we32k | ns16k | clipper | i370 | sh | shel | powerpc | powerpcle \
 		| 1750a | dsp16xx | pdp11 \
 		| mips64 | mipsel | mipseb | mips64el | mips64orion | mips64orionel \
 		| mipstx39 | mipstx39el \
@@ -229,7 +229,7 @@
 	      | alpha-* | alphaev5-* | alphaev56-* | alphapca56-* \
 	      | alphaev6-* | we32k-* | cydra-* | ns16k-* | pn-* | np1-* \
 	      | xps100-* | clipper-* | orion-* \
-	      | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
+	      | sparclite-* | pdp11-* | sh-* | shel-* | powerpc-* | powerpcle-* \
 	      | sparc64-* | mips64-* | mipsel-* | mipseb-* \
 	      | mips64el-* | mips64orion-* | mips64orionel-* \
 	      | mipstx39-* | mipstx39el-* \
diff -u -r -N -x *.orig -x CVS old/ld/Makefile.am binutils-2.9.1/ld/Makefile.am
--- ld/Makefile.am	Wed Jan  3 20:40:59 2001
+++ ld/Makefile.am	Wed Jan  3 20:49:44 2001
@@ -169,6 +169,10 @@
 	eshelf.o \
 	eshlelf.o \
 	eshl.o \
+	eshunx.o \
+	eshlunx.o \
+	eelf32shunx.o \
+	eelf32shlunx.o \
 	esparcaout.o \
 	esparclinux.o \
 	esparclynx.o \
@@ -488,6 +492,18 @@
 eshl.c: $(srcdir)/emulparams/shl.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} shl "$(tdir_shl)"
+eshunx.c: $(srcdir)/emulparams/shunx.sh \
+  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} shunx "$(tdir_shunx)"
+eshlunx.c: $(srcdir)/emulparams/shlunx.sh \
+  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} shlunx "$(tdir_shlunx)"
+eelf32shunx.c: $(srcdir)/emulparams/elf32shunx.sh \
+  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf32shunx "$(tdir_elf32shunx)"
+eelf32shlunx.c: $(srcdir)/emulparams/elf32shlunx.sh \
+  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf32shlunx "$(tdir_elf32shlunx)"
 esparcaout.c: $(srcdir)/emulparams/sparcaout.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} sparcaout "$(tdir_sparcaout)"
diff -u -r -N -x *.orig -x CVS old/ld/Makefile.in binutils-2.9.1/ld/Makefile.in
--- ld/Makefile.in	Wed Jan  3 20:40:59 2001
+++ ld/Makefile.in	Wed Jan  3 20:49:38 2001
@@ -245,6 +245,10 @@
 	eshelf.o \
 	eshlelf.o \
 	eshl.o \
+	eshunx.o \
+	eshlunx.o \
+	eelf32shunx.o \
+	eelf32shlunx.o \
 	esparcaout.o \
 	esparclinux.o \
 	esparclynx.o \
@@ -998,6 +1002,18 @@
 eshl.c: $(srcdir)/emulparams/shl.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} shl "$(tdir_shl)"
+eshunx.c: $(srcdir)/emulparams/shunx.sh \
+  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} shunx "$(tdir_shunx)"
+eshlunx.c: $(srcdir)/emulparams/shlunx.sh \
+  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} shlunx "$(tdir_shlunx)"
+eelf32shunx.c: $(srcdir)/emulparams/elf32shunx.sh \
+  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf32shunx "$(tdir_elf32shunx)"
+eelf32shlunx.c: $(srcdir)/emulparams/elf32shlunx.sh \
+  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf32shlunx "$(tdir_elf32shlunx)"
 esparcaout.c: $(srcdir)/emulparams/sparcaout.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} sparcaout "$(tdir_sparcaout)"
diff -u -r -N -x *.orig -x CVS old/ld/configure.tgt binutils-2.9.1/ld/configure.tgt
--- ld/configure.tgt	Wed Jan  3 20:41:00 2001
+++ ld/configure.tgt	Wed Jan  3 20:51:01 2001
@@ -114,8 +114,16 @@
 			targ_extra_emuls="h8500s h8500b h8500m h8500c"
 			;;
 sh-*-elf*)		targ_emul=shelf
-			targ_extra_emuls="shlelf sh shl"
+			targ_extra_emuls="shlelf shunx shlunx"
 			;;
+sh-*-netbsdelf)		targ_emul=elf32shunx
+			targ_extra_emuls="elf32shlunx shunx shlunx"
+			;;
+shel-*-netbsdelf)	targ_emul=elf32shlunx
+			targ_extra_emuls="elf32shunx shunx shlunx"
+			;;
+sh-*-netbsdcoff)	targ_emul=shunx; targ_extra_emuls=shlunx ;;
+shel-*-netbsdcoff)	targ_emul=shlunx; targ_extra_emuls=shunx ;;
 sh-*-*|sh-*-rtems*)	targ_emul=sh; targ_extra_emuls=shl ;;
 m68k-sony-*)		targ_emul=news ;;
 m68k-hp-bsd*)		targ_emul=hp300bsd ;;
diff -u -r -N -x *.orig -x CVS old/ld/emulparams/elf32shlunx.sh binutils-2.9.1/ld/emulparams/elf32shlunx.sh
--- ld/emulparams/elf32shlunx.sh	Thu Jan  1 09:00:00 1970
+++ ld/emulparams/elf32shlunx.sh	Wed Jan  3 20:51:16 2001
@@ -0,0 +1,15 @@
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-shl-unx"
+TEXT_START_ADDR=0x1000
+MAXPAGESIZE=0x1000
+ARCH=sh
+MACHINE=
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+
+# These are for compatibility with the COFF toolchain.
+ENTRY=start
+CTOR_START='___ctors = .;'
+CTOR_END='___ctors_end = .;'
+DTOR_START='___dtors = .;'
+DTOR_END='___dtors_end = .;'
diff -u -r -N -x *.orig -x CVS old/ld/emulparams/elf32shunx.sh binutils-2.9.1/ld/emulparams/elf32shunx.sh
--- ld/emulparams/elf32shunx.sh	Thu Jan  1 09:00:00 1970
+++ ld/emulparams/elf32shunx.sh	Wed Jan  3 20:51:33 2001
@@ -0,0 +1,15 @@
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-sh-unx"
+TEXT_START_ADDR=0x1000
+MAXPAGESIZE=0x1000
+ARCH=sh
+MACHINE=
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+
+# These are for compatibility with the COFF toolchain.
+ENTRY=start
+CTOR_START='___ctors = .;'
+CTOR_END='___ctors_end = .;'
+DTOR_START='___dtors = .;'
+DTOR_END='___dtors_end = .;'
diff -u -r -N -x *.orig -x CVS old/ld/emulparams/shlunx.sh binutils-2.9.1/ld/emulparams/shlunx.sh
--- ld/emulparams/shlunx.sh	Thu Jan  1 09:00:00 1970
+++ ld/emulparams/shlunx.sh	Wed Jan  3 20:51:54 2001
@@ -0,0 +1,5 @@
+SCRIPT_NAME=shunx
+OUTPUT_FORMAT="coff-shl"
+TEXT_START_ADDR=0x1000
+TARGET_PAGE_SIZE=0x1000
+ARCH=sh
diff -u -r -N -x *.orig -x CVS old/ld/emulparams/shunx.sh binutils-2.9.1/ld/emulparams/shunx.sh
--- ld/emulparams/shunx.sh	Thu Jan  1 09:00:00 1970
+++ ld/emulparams/shunx.sh	Wed Jan  3 20:52:04 2001
@@ -0,0 +1,5 @@
+SCRIPT_NAME=shunx
+OUTPUT_FORMAT="coff-sh"
+TEXT_START_ADDR=0x1000
+TARGET_PAGE_SIZE=0x1000
+ARCH=sh
diff -u -r -N -x *.orig -x CVS old/ld/scripttempl/shunx.sc binutils-2.9.1/ld/scripttempl/shunx.sc
--- ld/scripttempl/shunx.sc	Thu Jan  1 09:00:00 1970
+++ ld/scripttempl/shunx.sc	Wed Jan  3 20:52:24 2001
@@ -0,0 +1,53 @@
+TORS=".tors :
+  {
+    ___ctors = . ;
+    *(.ctors)
+    ___ctors_end = . ;
+    ___dtors = . ;
+    *(.dtors)
+    ___dtors_end = . ;
+  }"
+
+
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_ARCH(${ARCH})
+${LIB_SEARCH_DIRS}
+
+SECTIONS
+{
+  . = ${TEXT_START_ADDR} + SIZEOF_HEADERS;
+  .text ALIGN(0x10):
+  {
+    *(.text)
+    *(.strings)
+    ${RELOCATING+ _etext = . ; }
+  }
+  ${CONSTRUCTING+${TORS}}
+  .data  ${RELOCATING+ ALIGN(${TARGET_PAGE_SIZE})} :
+  {
+    *(.data)
+    ${RELOCATING+ _edata = . ; }
+  }
+  .bss ${RELOCATING+ ALIGN(${TARGET_PAGE_SIZE})} :
+  {
+    ${RELOCATING+ _bss_start = . ; }
+    *(.bss)
+    *(COMMON)
+    ${RELOCATING+ _end = . ;  }
+  }
+  .stack :
+  {
+    ${RELOCATING+ _stack = . ; }
+    *(.stack)
+  }
+  .stab 0 ${RELOCATING+(NOLOAD)} :
+  {
+    *(.stab)
+  }
+  .stabstr 0 ${RELOCATING+(NOLOAD)} :
+  {
+    *(.stabstr)
+  }
+}
+EOF
--- gas/configure-	Wed Jan  3 21:34:11 2001
+++ gas/configure	Wed Jan  3 21:35:19 2001
@@ -1408,2 +1408,4 @@
       rs6000*)		cpu_type=ppc ;;
+      shel*)		cpu_type=sh endian=little ;;
+      sh*)		cpu_type=sh endian=big ;;
       sparclite*)	cpu_type=sparc arch=sparclite ;;
@@ -1596,2 +1598,4 @@
       sh-*-rtems*)	    fmt=coff ;;
+      sh-*-netbsdelf*)	    fmt=elf em=nbsd ;;
+      sh-*-netbsdcoff*)	    fmt=coff em=nbsd ;;
 
--- gas/configure.in-	Wed Jan  3 21:34:13 2001
+++ gas/configure.in	Wed Jan  3 21:35:31 2001
@@ -88,2 +88,4 @@
       rs6000*)		cpu_type=ppc ;;
+      shel*)		cpu_type=sh endian=little ;;
+      sh*)		cpu_type=sh endian=big ;;
       sparclite*)	cpu_type=sparc arch=sparclite ;;
@@ -264,2 +266,4 @@
       sh-*-rtems*)	    fmt=coff ;;
+      sh-*-netbsdelf*)	    fmt=elf em=nbsd ;;
+      sh-*-netbsdcoff*)	    fmt=coff em=nbsd ;;
 
--- gas/config/tc-sh.h-	Wed Jan  3 21:35:53 2001
+++ gas/config/tc-sh.h	Wed Jan  3 21:36:21 2001
@@ -22,3 +22,6 @@
 
+/* Set the endianness we are using.  Default to little endian.  */
+#ifndef TARGET_BYTES_BIG_ENDIAN
 #define TARGET_BYTES_BIG_ENDIAN 0
+#endif
 
@@ -136,3 +139,7 @@
 
+#ifdef TE_NetBSD
+#define TARGET_FORMAT (shl ? "elf32-shl-unx" : "elf32-sh-unx")
+#else
 #define TARGET_FORMAT (shl ? "elf32-shl" : "elf32-sh")
+#endif