This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Get rid of more bfd bloat


Gets rid of most of the cases where ELF targets #include a C file just
to make minor target variations.  The one case left is elf32-sh64.c
which includes elf32-sh.c.

	* Makefile.am (BFD32_BACKENDS): Remove elfarmqnx-nabi.lo,
	elf32-i386-fbsd.lo, elf32-i386qnx.lo, elf32-ppcqnx.lo, 
	elf32-sh-lin.lo, elf32-sh64-lin.lo, elf32-sh-nbsd.lo,
	elf32-sh64-nbsd.lo, elf32-shqnx.lo.  Add elf32-qnx.lo.
	(BFD32_BACKENDS_CFILES): Likewise for corresponding C files.
	(BFD64_BACKENDS): Remove elf64-sh64-lin.lo, elf64-sh64-nbsd.lo.
	(BFD64_BACKENDS_CFILES): Likewise for corresponding C files.
	(SOURCE_HFILES): Add elf32-qnx.h.
	(BUILD_HFILES): Add bfdver.h.
	Run "make dep-am".
	* Makefile.in: Regenerate.
	* configure.in Update bfd vector dependencies.
	* configure: Regenerate.
	* elf32-i386-fbsd.c: Delete.  Move code to elf32-i386.c.
	* elf32-i386qnx.c: Likewise.
	* elf32-ppcqnx.c: Delete.  Move code to elf32-ppc.c.
	* elf32-sh-nbsd.c: Delete.  Move code to elf32-sh.c.
	* elf32-sh-lin.c: Likewise.
	* elf32-shqnx.c: Likewise.
	* elf32-sh64-lin.c: Delete.  Move code to elf32-sh64.c.
	* elf32-sh64-nbsd.c: Likewise.
	* elf64-sh64-lin.c: Delete.  Move code to elf64-sh64.c.
	* elf64-sh64-nbsd.c: Likewise.
	* elfarmqnx-nabi.c: Delete.  Move code to elfarm-nabi.c.
	* elf32-arm.h (ELF_MAXPAGESIZE): Always define.
	* elf32-i386.c: Remove ELF_ARCH and ELF32_I386_C_INCLUDED tests.
	* elf32-ppc.c: Remove ELF32_PPC_C_INCLUDED tests.
	* elf32-qnx.h (elf_backend_set_nonloadable_filepos): Always define.
	(elf_backend_is_contained_by_filepos): Likewise.
	(elf_backend_copy_private_bfd_data_p): Likewise.
	Globalize and move functions to..
	* elf32-qnx.c: ..here.  New file.
	* elf32-sh.c: Remove ELF_ARCH and ELF32_SH_C_INCLUDED tests.  Don't
	emit target vectors when INCLUDE_SHMEDIA.
	* elf32-sh64.c: Remove ELF_ARCH test.  Move TARGET_* etc. defines to
	end of file.
	* elf64-sh64.c: Remove ELF_ARCH test.
	* elfarm-nabi.c: Remove ELFARM_NABI_C_INCLUDED test.
	* po/BLD-POTFILES.in: Regenerate.
	* po/SRC-POTFILES.in: Regenerate.

Index: bfd/Makefile.am
===================================================================
RCS file: /cvs/src/src/bfd/Makefile.am,v
retrieving revision 1.106
diff -u -p -r1.106 Makefile.am
--- bfd/Makefile.am	15 Oct 2002 17:14:50 -0000	1.106
+++ bfd/Makefile.am	16 Oct 2002 06:22:34 -0000
@@ -203,7 +203,6 @@ BFD32_BACKENDS = \
 	elf32-arc.lo \
 	elfarm-oabi.lo \
 	elfarm-nabi.lo \
-	elfarmqnx-nabi.lo \
 	elf32-avr.lo \
 	elf32-cris.lo \
 	elf32-d10v.lo \
@@ -216,8 +215,6 @@ BFD32_BACKENDS = \
 	elf32-hppa.lo \
 	elf32-i370.lo \
 	elf32-i386.lo \
-	elf32-i386-fbsd.lo \
-	elf32-i386qnx.lo \
 	elf32-i860.lo \
 	elf32-i960.lo \
 	elf32-ia64.lo \
@@ -236,16 +233,11 @@ BFD32_BACKENDS = \
 	elf32-or32.lo \
 	elf32-pj.lo \
 	elf32-ppc.lo \
-	elf32-ppcqnx.lo \
+	elf32-qnx.lo \
 	elf32-s390.lo \
 	elf32-sh.lo \
-	elf32-sh-lin.lo \
 	elf32-sh64.lo \
 	elf32-sh64-com.lo \
-	elf32-sh64-lin.lo \
-	elf32-sh-nbsd.lo \
-	elf32-sh64-nbsd.lo \
-	elf32-shqnx.lo \
 	elf32-sparc.lo \
 	elf32-v850.lo \
 	elf32-vax.lo \
@@ -367,7 +359,6 @@ BFD32_BACKENDS_CFILES = \
 	elf32-arc.c \
 	elfarm-oabi.c \
 	elfarm-nabi.c \
-	elfarmqnx-nabi.c \
 	elf32-avr.c \
 	elf32-cris.c \
 	elf32-d10v.c \
@@ -380,8 +371,6 @@ BFD32_BACKENDS_CFILES = \
 	elf32-hppa.c \
 	elf32-i370.c \
 	elf32-i386.c \
-	elf32-i386-fbsd.c \
-	elf32-i386qnx.c \
 	elf32-i860.c \
 	elf32-i960.c \
 	elf32-ip2k.c \
@@ -399,16 +388,11 @@ BFD32_BACKENDS_CFILES = \
 	elf32-or32.c \
 	elf32-pj.c \
 	elf32-ppc.c \
-	elf32-ppcqnx.c \
+	elf32-qnx.c \
 	elf32-sh64.c \
 	elf32-sh64-com.c \
-	elf32-sh64-lin.c \
 	elf32-s390.c \
 	elf32-sh.c \
-	elf32-sh-lin.c \
-	elf32-sh-nbsd.c \
-	elf32-sh64-nbsd.c \
-	elf32-shqnx.c \
 	elf32-sparc.c \
 	elf32-v850.c \
 	elf32-vax.c \
@@ -498,8 +482,6 @@ BFD64_BACKENDS = \
 	elf64-mips.lo \
 	elf64-mmix.lo \
 	elf64-sh64.lo \
-	elf64-sh64-lin.lo \
-	elf64-sh64-nbsd.lo \
 	elf64-ppc.lo \
 	elf64-s390.lo \
 	elf64-sparc.lo \
@@ -526,8 +508,6 @@ BFD64_BACKENDS_CFILES = \
 	elf64-ppc.c \
 	elf64-s390.c \
 	elf64-sh64.c \
-	elf64-sh64-lin.c \
-	elf64-sh64-nbsd.c \
 	elf64-sparc.c \
 	elf64.c \
 	mmo.c \
@@ -581,16 +561,17 @@ CFILES = $(SOURCE_CFILES) $(BUILD_CFILES
 ## This is a list of all .h files which are in the source tree.
 SOURCE_HFILES = \
 	aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \
-	elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h elf64-hppa.h \
-	elfcode.h elfcore.h elflink.h freebsd.h genlink.h go32stub.h \
-	libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \
-	libieee.h libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h \
-	nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h libxcoff.h \
-	xcoff-target.h version.h
+	elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h elf32-qnx.h \
+	elf64-hppa.h elfcode.h elfcore.h elflink.h \
+	freebsd.h genlink.h go32stub.h \
+	libaout.h libbfd.h libcoff.h libecoff.h libhppa.h libieee.h \
+	libnlm.h liboasys.h libpei.h libxcoff.h \
+	netbsd.h nlm-target.h nlmcode.h nlmswap.h ns32k.h \
+	peicode.h som.h version.h vms.h xcoff-target.h
 
 ## ... and all .h files which are in the build tree.
 BUILD_HFILES = \
-	elf32-target.h elf64-target.h targmatch.h
+	bfdver.h elf32-target.h elf64-target.h targmatch.h
 
 HFILES = $(SOURCE_HFILES) $(BUILD_HFILES)
 
[snip dependency changes]

Index: bfd/configure.in
===================================================================
RCS file: /cvs/src/src/bfd/configure.in,v
retrieving revision 1.117
diff -u -p -r1.117 configure.in
--- bfd/configure.in	15 Oct 2002 17:14:51 -0000	1.117
+++ bfd/configure.in	16 Oct 2002 06:22:43 -0000
@@ -557,8 +557,8 @@ do
     bfd_elf32_big_generic_vec) 	tb="$tb elf32-gen.lo elf32.lo $elf" ;;
     bfd_elf32_bigarc_vec)	tb="$tb elf32-arc.lo elf32.lo $elf" ;;
     bfd_elf32_bigarm_oabi_vec)	tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
-    bfd_elf32_bigarm_vec)	tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
-    bfd_elf32_bigarmqnx_vec)	tb="$tb elfarmqnx-nabi.lo elfarm-nabi.lo elf32.lo $elf" ;;
+    bfd_elf32_bigarm_vec)	tb="$tb elfarm-nabi.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_bigarmqnx_vec)	tb="$tb elfarm-nabi.lo elf32-qnx.lo elf32.lo $elf" ;;
     bfd_elf32_bigmips_vec) 	tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
     bfd_elf32_cris_vec)		tb="$tb elf32-cris.lo elf32.lo $elf" ;;
     bfd_elf32_d10v_vec)		tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
@@ -570,9 +570,9 @@ do
     bfd_elf32_hppa_linux_vec)	tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     bfd_elf32_hppa_vec)		tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     bfd_elf32_i370_vec)		tb="$tb elf32-i370.lo elf32.lo $elf" ;;
-    bfd_elf32_i386_freebsd_vec)	tb="$tb elf32-i386-fbsd.lo elf32.lo $elf" ;;
-    bfd_elf32_i386_vec)		tb="$tb elf32-i386.lo elf32.lo $elf" ;;
-    bfd_elf32_i386qnx_vec)	tb="$tb elf32-i386qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_i386_freebsd_vec)	tb="$tb elf32-i386.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_i386_vec)		tb="$tb elf32-i386.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_i386qnx_vec)	tb="$tb elf32-i386.lo elf32-qnx.lo elf32.lo $elf" ;;
     bfd_elf32_i860_little_vec)	tb="$tb elf32-i860.lo elf32.lo $elf" ;;
     bfd_elf32_i860_vec)		tb="$tb elf32-i860.lo elf32.lo $elf" ;;
     bfd_elf32_i960_vec)		tb="$tb elf32-i960.lo elf32.lo $elf" ;;
@@ -582,8 +582,8 @@ do
     bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
     bfd_elf32_littlearc_vec)	tb="$tb elf32-arc.lo elf32.lo $elf" ;;
     bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
-    bfd_elf32_littlearm_vec)	tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
-    bfd_elf32_littlearmqnx_vec)	tb="$tb elfarmqnx-nabi.lo elfarm-nabi.lo elf32.lo $elf" ;;
+    bfd_elf32_littlearm_vec)	tb="$tb elfarm-nabi.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_littlearmqnx_vec)	tb="$tb elfarm-nabi.lo elf32-qnx.lo elf32.lo $elf" ;;
     bfd_elf32_littlemips_vec) 	tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
     bfd_elf32_m32r_vec)		tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
     bfd_elf32_m68hc11_vec)	tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;;
@@ -602,28 +602,28 @@ do
     bfd_elf32_or32_big_vec)	tb="$tb elf32-or32.lo elf32.lo $elf" ;;
     bfd_elf32_pj_vec)           tb="$tb elf32-pj.lo elf32.lo $elf";;
     bfd_elf32_pjl_vec)          tb="$tb elf32-pj.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_powerpcleqnx_vec)	tb="$tb elf32-ppcqnx.lo elf32-ppc.lo elf32.lo $elf" ;;
-    bfd_elf32_powerpcqnx_vec)	tb="$tb elf32-ppcqnx.lo elf32-ppc.lo elf32.lo $elf" ;;
+    bfd_elf32_powerpc_vec)	tb="$tb elf32-ppc.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_powerpcle_vec)	tb="$tb elf32-ppc.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_powerpcleqnx_vec)	tb="$tb elf32-ppc.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_powerpcqnx_vec)	tb="$tb elf32-ppc.lo elf32-qnx.lo elf32.lo $elf" ;;
     bfd_elf32_s390_vec)		tb="$tb elf32-s390.lo elf32.lo $elf" ;;
     # FIXME: We include cofflink.lo not because it's needed for
     # bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec
     # which needs it but does not list it.  Should be fixed in right place.
     bfd_elf32_sh64_vec)		tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
     bfd_elf32_sh64l_vec)	tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
-    bfd_elf32_sh64lin_vec)	tb="$tb elf32-sh64-lin.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
-    bfd_elf32_sh64blin_vec)	tb="$tb elf32-sh64-lin.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
-    bfd_elf32_sh64lnbsd_vec)	tb="$tb elf32-sh64-nbsd.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
-    bfd_elf32_sh64nbsd_vec)	tb="$tb elf32-sh64-nbsd.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
-    bfd_elf32_sh_vec)		tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
-    bfd_elf32_shblin_vec)	tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
-    bfd_elf32_shl_vec)		tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
-    bfd_elf32_shlin_vec)	tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
-    bfd_elf32_shlnbsd_vec)	tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
-    bfd_elf32_shlqnx_vec)	tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
-    bfd_elf32_shnbsd_vec)	tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
-    bfd_elf32_shqnx_vec)	tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
+    bfd_elf32_sh64lin_vec)	tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
+    bfd_elf32_sh64blin_vec)	tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
+    bfd_elf32_sh64lnbsd_vec)	tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
+    bfd_elf32_sh64nbsd_vec)	tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
+    bfd_elf32_sh_vec)		tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo" ;;
+    bfd_elf32_shblin_vec)	tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+    bfd_elf32_shl_vec)		tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo elf32-qnx.lo $elf coff-sh.lo" ;;
+    bfd_elf32_shlin_vec)	tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+    bfd_elf32_shlnbsd_vec)	tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+    bfd_elf32_shlqnx_vec)	tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo" ;;
+    bfd_elf32_shnbsd_vec)	tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+    bfd_elf32_shqnx_vec)	tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_sparc_vec)	tb="$tb elf32-sparc.lo elf32.lo $elf" ;;
     bfd_elf32_tradbigmips_vec)  tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
     bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
@@ -650,10 +650,10 @@ do
     bfd_elf64_s390_vec)		tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_sh64_vec)		tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_sh64l_vec)	tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
-    bfd_elf64_sh64lin_vec)	tb="$tb elf64-sh64-lin.lo elf64.lo $elf" target_size=64 ;;
-    bfd_elf64_sh64blin_vec)	tb="$tb elf64-sh64-lin.lo elf64.lo $elf" target_size=64 ;;
-    bfd_elf64_sh64lnbsd_vec)	tb="$tb elf64-sh64-nbsd.lo elf64.lo $elf" target_size=64 ;;
-    bfd_elf64_sh64nbsd_vec)	tb="$tb elf64-sh64-nbsd.lo elf64.lo $elf" target_size=64 ;;
+    bfd_elf64_sh64lin_vec)	tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
+    bfd_elf64_sh64blin_vec)	tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
+    bfd_elf64_sh64lnbsd_vec)	tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
+    bfd_elf64_sh64nbsd_vec)	tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_sparc_vec)	tb="$tb elf64-sparc.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_tradbigmips_vec)	tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
     bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
Index: bfd/elf32-arm.h
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.h,v
retrieving revision 1.94
diff -u -p -r1.94 elf32-arm.h
--- bfd/elf32-arm.h	11 Oct 2002 08:33:11 -0000	1.94
+++ bfd/elf32-arm.h	16 Oct 2002 06:22:45 -0000
@@ -3649,9 +3649,7 @@ elf32_arm_reloc_type_class (rela)
 
 #define ELF_ARCH			bfd_arch_arm
 #define ELF_MACHINE_CODE		EM_ARM
-#ifndef ELF_MAXPAGESIZE
 #define ELF_MAXPAGESIZE			0x8000
-#endif
 
 #define bfd_elf32_bfd_copy_private_bfd_data	elf32_arm_copy_private_bfd_data
 #define bfd_elf32_bfd_merge_private_bfd_data	elf32_arm_merge_private_bfd_data
Index: bfd/elf32-i386-fbsd.c
===================================================================
RCS file: bfd/elf32-i386-fbsd.c
diff -N bfd/elf32-i386-fbsd.c
--- bfd/elf32-i386-fbsd.c	17 Sep 2002 19:49:04 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,56 +0,0 @@
-/* Intel IA-32 specific support for 32-bit ELF on FreeBSD.
-   Copyright 2002 Free Software Foundation, Inc.
-
-This file is part of BFD, the Binary File Descriptor library.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define TARGET_LITTLE_SYM	bfd_elf32_i386_freebsd_vec
-#define TARGET_LITTLE_NAME	"elf32-i386-freebsd"
-#define ELF_ARCH		bfd_arch_i386
-#define ELF_MACHINE_CODE	EM_386
-#define ELF_MAXPAGESIZE		0x1000
-
-#include "bfd.h"
-#include "sysdep.h"
-#include "elf-bfd.h"
-
-/* The kernel recognizes executables as valid only if they carry a
-   "FreeBSD" label in the ELF header.  So we put this label on all
-   executables and (for simplicity) also all other object files.  */
-
-static void elf_i386_post_process_headers
-  PARAMS ((bfd *, struct bfd_link_info *));
-
-static void
-elf_i386_post_process_headers (abfd, link_info)
-     bfd * abfd;
-     struct bfd_link_info * link_info ATTRIBUTE_UNUSED;
-{
-  Elf_Internal_Ehdr * i_ehdrp;	/* ELF file header, internal form.  */
-
-  i_ehdrp = elf_elfheader (abfd);
-
-  /* Put an ABI label supported by FreeBSD >= 4.1.  */
-  i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
-#ifdef OLD_FREEBSD_ABI_LABEL
-  /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard.  */
-  memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8);
-#endif
-}
-
-#define elf_backend_post_process_headers	elf_i386_post_process_headers
-
-#include "elf32-i386.c"
Index: bfd/elf32-i386.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-i386.c,v
retrieving revision 1.87
diff -u -p -r1.87 elf32-i386.c
--- bfd/elf32-i386.c	8 Oct 2002 16:11:07 -0000	1.87
+++ bfd/elf32-i386.c	16 Oct 2002 06:22:53 -0000
@@ -3348,13 +3348,11 @@ elf_i386_finish_dynamic_sections (output
   return true;
 }
 
-#ifndef ELF_ARCH
 #define TARGET_LITTLE_SYM		bfd_elf32_i386_vec
 #define TARGET_LITTLE_NAME		"elf32-i386"
 #define ELF_ARCH			bfd_arch_i386
 #define ELF_MACHINE_CODE		EM_386
 #define ELF_MAXPAGESIZE			0x1000
-#endif /* ELF_ARCH */
 
 #define elf_backend_can_gc_sections	1
 #define elf_backend_can_refcount	1
@@ -3389,6 +3387,62 @@ elf_i386_finish_dynamic_sections (output
 #define elf_backend_relocate_section	      elf_i386_relocate_section
 #define elf_backend_size_dynamic_sections     elf_i386_size_dynamic_sections
 
-#ifndef ELF32_I386_C_INCLUDED
 #include "elf32-target.h"
+
+/* FreeBSD support.  */
+
+#undef	TARGET_LITTLE_SYM
+#define	TARGET_LITTLE_SYM		bfd_elf32_i386_freebsd_vec
+#undef	TARGET_LITTLE_NAME
+#define	TARGET_LITTLE_NAME		"elf32-i386-freebsd"
+
+/* The kernel recognizes executables as valid only if they carry a
+   "FreeBSD" label in the ELF header.  So we put this label on all
+   executables and (for simplicity) also all other object files.  */
+
+static void elf_i386_post_process_headers
+  PARAMS ((bfd *, struct bfd_link_info *));
+
+static void
+elf_i386_post_process_headers (abfd, link_info)
+     bfd *abfd;
+     struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
+{
+  Elf_Internal_Ehdr *i_ehdrp;
+
+  i_ehdrp = elf_elfheader (abfd);
+
+  /* Put an ABI label supported by FreeBSD >= 4.1.  */
+  i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
+#ifdef OLD_FREEBSD_ABI_LABEL
+  /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard.  */
+  memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8);
 #endif
+}
+
+#undef	elf_backend_post_process_headers
+#define	elf_backend_post_process_headers      elf_i386_post_process_headers
+
+#define	elf32_bed			elf32_i386_fbsd_bed
+
+#include "elf32-target.h"
+
+#undef	elf_backend_post_process_headers
+#undef	elf32_bed
+
+/* QNX support.  */
+#include "elf32-qnx.h"
+
+#undef	TARGET_LITTLE_SYM
+#define	TARGET_LITTLE_SYM		bfd_elf32_i386qnx_vec
+#undef	TARGET_LITTLE_NAME
+#define	TARGET_LITTLE_NAME		"elf32-i386-nto"
+
+#define	elf32_bed			elf32_i386_qnx_bed
+
+#include "elf32-target.h"
+
+#undef	elf_backend_set_nonloadable_filepos
+#undef	elf_backend_is_contained_by_filepos
+#undef	elf_backend_copy_private_bfd_data_p
+#undef	elf32_bed
Index: bfd/elf32-i386qnx.c
===================================================================
RCS file: bfd/elf32-i386qnx.c
diff -N bfd/elf32-i386qnx.c
--- bfd/elf32-i386qnx.c	16 Oct 2002 00:56:41 -0000	1.4
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,31 +0,0 @@
-/* Intel 80386/80486 QNX specific support for 32-bit ELF
-   Copyright 2002
-   Free Software Foundation, Inc.
-
-   This file is part of BFD, the Binary File Descriptor library.
-   
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define ELF32_I386_C_INCLUDED
-#include "elf32-i386.c"
-
-#include "elf32-qnx.h"
-
-#undef  TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM		bfd_elf32_i386qnx_vec
-#undef  TARGET_LITTLE_NAME
-#define TARGET_LITTLE_NAME		"elf32-i386-nto"
-
-#include "elf32-target.h"
Index: bfd/elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.52
diff -u -p -r1.52 elf32-ppc.c
--- bfd/elf32-ppc.c	21 Sep 2002 10:09:13 -0000	1.52
+++ bfd/elf32-ppc.c	16 Oct 2002 06:22:57 -0000
@@ -3849,7 +3849,25 @@ ppc_elf_grok_psinfo (abfd, note)
 #define elf_backend_grok_psinfo			ppc_elf_grok_psinfo
 #define elf_backend_reloc_type_class		ppc_elf_reloc_type_class
 
-#ifndef ELF32_PPC_C_INCLUDED
 #include "elf32-target.h"
-#endif
 
+/* QNX support.  */
+#include "elf32-qnx.h"
+
+#undef	TARGET_LITTLE_SYM 
+#define	TARGET_LITTLE_SYM		bfd_elf32_powerpcleqnx_vec
+#undef	TARGET_LITTLE_NAME
+#define	TARGET_LITTLE_NAME		"elf32-powerpcle-nto"
+#undef	TARGET_BIG_SYM
+#define	TARGET_BIG_SYM			bfd_elf32_powerpcqnx_vec
+#undef	TARGET_BIG_NAME
+#define	TARGET_BIG_NAME			"elf32-powerpc-nto"
+
+#define	elf32_bed			elf32_ppc_qnx_bed
+
+#include "elf32-target.h"
+
+#undef	elf_backend_set_nonloadable_filepos
+#undef	elf_backend_is_contained_by_filepos
+#undef	elf_backend_copy_private_bfd_data_p
+#undef	elf32_bed
Index: bfd/elf32-ppcqnx.c
===================================================================
RCS file: bfd/elf32-ppcqnx.c
diff -N bfd/elf32-ppcqnx.c
--- bfd/elf32-ppcqnx.c	16 Oct 2002 00:56:41 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,35 +0,0 @@
-/* PowerPC QNX specific support for 32-bit ELF
-   Copyright 2002 
-   Free Software Foundation, Inc.
-
-   This file is part of BFD, the Binary File Descriptor library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define ELF32_PPC_C_INCLUDED
-#include "elf32-ppc.c"
-
-#include "elf32-qnx.h"
-
-#undef  TARGET_LITTLE_SYM 
-#define TARGET_LITTLE_SYM       bfd_elf32_powerpcleqnx_vec
-#undef  TARGET_LITTLE_NAME
-#define TARGET_LITTLE_NAME	"elf32-powerpcle-nto"
-#undef  TARGET_BIG_SYM
-#define TARGET_BIG_SYM          bfd_elf32_powerpcqnx_vec
-#undef  TARGET_BIG_NAME
-#define TARGET_BIG_NAME		"elf32-powerpc-nto"
-
-#include "elf32-target.h"
Index: bfd/elf32-qnx.c
===================================================================
RCS file: bfd/elf32-qnx.c
diff -N bfd/elf32-qnx.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ bfd/elf32-qnx.c	16 Oct 2002 06:22:57 -0000
@@ -0,0 +1,92 @@
+/* QNX specific support for 32-bit ELF
+   Copyright 2002  Free Software Foundation, Inc.
+
+   This file is part of BFD, the Binary File Descriptor library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "elf-bfd.h"
+#include "elf32-qnx.h"
+
+/* Returns the end address of the segment + 1.  */
+#define SEGMENT_END(segment, start)                     \
+  (start + (segment->p_memsz > segment->p_filesz        \
+   ? segment->p_memsz : segment->p_filesz))
+
+boolean
+elf_qnx_copy_private_bfd_data_p (ibfd, isec, obfd, osec)
+     bfd *ibfd ATTRIBUTE_UNUSED;
+     asection *isec;
+     bfd *obfd ATTRIBUTE_UNUSED;
+     asection *osec ATTRIBUTE_UNUSED;
+{
+  return isec->next == NULL;
+}
+
+boolean
+elf_qnx_is_contained_by_filepos (section, segment)
+     asection *section;
+     Elf_Internal_Phdr *segment;
+{
+  return ((bfd_vma) section->filepos >= segment->p_offset
+          && ((bfd_vma) section->filepos + section->_raw_size
+	      <= SEGMENT_END (segment, segment->p_offset)));
+}
+
+void
+elf_qnx_set_nonloadable_filepos (abfd, phdrs)
+     bfd *abfd;
+     Elf_Internal_Phdr *phdrs;
+{
+  struct elf_segment_map *m;
+  Elf_Internal_Phdr *p;
+  file_ptr off = 0;
+
+  for (m = elf_tdata (abfd)->segment_map, p = phdrs;
+       m != NULL;
+       m = m->next, p++)
+    {
+      unsigned int i;
+      asection **secpp;
+
+      for (i = 0, secpp = m->sections; i < m->count; i++, secpp++)
+        {
+          asection *sec;
+
+          sec = *secpp;
+
+          if (p->p_type == PT_LOAD)
+	    off = sec->filepos;
+          else
+            {
+              if (i == 0)
+                {
+                  if (sec->filepos)
+                    p->p_offset = sec->filepos;
+                  else
+                    p->p_offset = off;
+                }
+              if (!sec->filepos)
+                {
+                  off += sec->_raw_size;
+                  p->p_filesz += sec->_raw_size;
+                }
+            }
+        }
+    }
+  return;
+}
Index: bfd/elf32-qnx.h
===================================================================
RCS file: /cvs/src/src/bfd/elf32-qnx.h,v
retrieving revision 1.2
diff -u -p -r1.2 elf32-qnx.h
--- bfd/elf32-qnx.h	22 Aug 2002 17:27:19 -0000	1.2
+++ bfd/elf32-qnx.h	16 Oct 2002 06:22:57 -0000
@@ -14,98 +14,19 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-  /* Returns the end address of the segment + 1.  */
-#define SEGMENT_END(segment, start)                     \
-  (start + (segment->p_memsz > segment->p_filesz        \
-   ? segment->p_memsz : segment->p_filesz))
-
-static boolean elf_qnx_copy_private_bfd_data_p
+boolean elf_qnx_copy_private_bfd_data_p
   PARAMS ((bfd *, asection *, bfd *, asection *));
-static boolean elf_qnx_is_contained_by_filepos
+boolean elf_qnx_is_contained_by_filepos
   PARAMS ((asection *, Elf_Internal_Phdr *));
-static void elf_qnx_set_nonloadable_filepos
+void elf_qnx_set_nonloadable_filepos
   PARAMS ((bfd *, Elf_Internal_Phdr *));
 
-static boolean
-elf_qnx_copy_private_bfd_data_p (ibfd, isec, obfd, osec)
-     bfd *ibfd;
-     asection *isec;
-     bfd *obfd;
-     asection *osec;
-{
-  /* We don't use these parameters, but another target might.  */
-  ibfd = ibfd;
-  obfd = obfd;
-  osec = osec;
-
-  return isec->next == NULL;
-}
-
-static boolean
-elf_qnx_is_contained_by_filepos (section, segment)
-     asection *section;
-     Elf_Internal_Phdr *segment;
-{
-  return ((bfd_vma) section->filepos >= segment->p_offset
-          && ((bfd_vma) section->filepos + section->_raw_size
-	      <= SEGMENT_END (segment, segment->p_offset)));
-}
-
-static void
-elf_qnx_set_nonloadable_filepos (abfd, phdrs)
-     bfd *abfd;
-     Elf_Internal_Phdr *phdrs;
-{
-  struct elf_segment_map *m;
-  Elf_Internal_Phdr *p;
-  file_ptr off = 0;
-
-  for (m = elf_tdata (abfd)->segment_map, p = phdrs;
-       m != NULL;
-       m = m->next, p++)
-    {
-      unsigned int i;
-      asection **secpp;
-
-      for (i = 0, secpp = m->sections; i < m->count; i++, secpp++)
-        {
-          asection *sec;
-
-          sec = *secpp;
-
-          if (p->p_type == PT_LOAD)
-	    off = sec->filepos;
-          else
-            {
-              if (i == 0)
-                {
-                  if (sec->filepos)
-                    p->p_offset = sec->filepos;
-                  else
-                    p->p_offset = off;
-                }
-              if (!sec->filepos)
-                {
-                  off += sec->_raw_size;
-                  p->p_filesz += sec->_raw_size;
-                }
-            }
-        }
-    }
-  return;
-}
-
-#ifndef elf_backend_set_nonloadable_filepos
-#define elf_backend_set_nonloadable_filepos elf_qnx_set_nonloadable_filepos
-#endif
-
-#ifndef elf_backend_is_contained_by_filepos
-#define elf_backend_is_contained_by_filepos elf_qnx_is_contained_by_filepos
-#endif
-
-#ifndef elf_backend_copy_private_bfd_data_p
-#define elf_backend_copy_private_bfd_data_p elf_qnx_copy_private_bfd_data_p
-#endif
+#undef	elf_backend_set_nonloadable_filepos
+#define	elf_backend_set_nonloadable_filepos elf_qnx_set_nonloadable_filepos
+#undef	elf_backend_is_contained_by_filepos
+#define	elf_backend_is_contained_by_filepos elf_qnx_is_contained_by_filepos
+#undef	elf_backend_copy_private_bfd_data_p
+#define	elf_backend_copy_private_bfd_data_p elf_qnx_copy_private_bfd_data_p
Index: bfd/elf32-sh-lin.c
===================================================================
RCS file: bfd/elf32-sh-lin.c
diff -N bfd/elf32-sh-lin.c
--- bfd/elf32-sh-lin.c	18 Sep 2001 09:57:24 -0000	1.4
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,110 +0,0 @@
-/* Hitachi SH specific support for 32-bit Linux
-   Copyright 2000, 2001 Free Software Foundation, Inc.
-
-This file is part of BFD, the Binary File Descriptor library.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define TARGET_BIG_SYM bfd_elf32_shblin_vec
-#define TARGET_BIG_NAME "elf32-shbig-linux"
-#define TARGET_LITTLE_SYM bfd_elf32_shlin_vec
-#define TARGET_LITTLE_NAME "elf32-sh-linux"
-#define ELF_ARCH bfd_arch_sh
-#define ELF_MACHINE_CODE EM_SH
-#define ELF_MAXPAGESIZE 0x10000
-#define elf_symbol_leading_char 0
-
-#include "bfd.h"
-#include "sysdep.h"
-#include "elf/internal.h"
-#include "elf-bfd.h"
-
-static boolean elf32_shlin_grok_prstatus
-  PARAMS ((bfd *abfd, Elf_Internal_Note *note));
-static boolean elf32_shlin_grok_psinfo
-  PARAMS ((bfd *abfd, Elf_Internal_Note *note));
-
-/* Support for core dump NOTE sections */
-static boolean
-elf32_shlin_grok_prstatus (abfd, note)
-     bfd *abfd;
-     Elf_Internal_Note *note;
-{
-  int offset;
-  unsigned int raw_size;
-
-  switch (note->descsz)
-    {
-      default:
-	return false;
-
-      case 168:		/* Linux/SH */
-	/* pr_cursig */
-	elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
-
-	/* pr_pid */
-	elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24);
-
-	/* pr_reg */
-	offset = 72;
-	raw_size = 92;
-
-	break;
-    }
-
-  /* Make a ".reg/999" section.  */
-  return _bfd_elfcore_make_pseudosection (abfd, ".reg",
-					  raw_size, note->descpos + offset);
-}
-
-static boolean
-elf32_shlin_grok_psinfo (abfd, note)
-     bfd *abfd;
-     Elf_Internal_Note *note;
-{
-  switch (note->descsz)
-    {
-      default:
-	return false;
-
-      case 124:		/* Linux/SH elf_prpsinfo */
-	elf_tdata (abfd)->core_program
-	 = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
-	elf_tdata (abfd)->core_command
-	 = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
-    }
-
-  /* Note that for some reason, a spurious space is tacked
-     onto the end of the args in some (at least one anyway)
-     implementations, so strip it off if it exists.  */
-
-  {
-    char *command = elf_tdata (abfd)->core_command;
-    int n = strlen (command);
-
-    if (0 < n && command[n - 1] == ' ')
-      command[n - 1] = '\0';
-  }
-
-  return true;
-}
-
-
-#define elf_backend_grok_prstatus	elf32_shlin_grok_prstatus
-#define elf_backend_grok_psinfo		elf32_shlin_grok_psinfo
-
-
-
-#include "elf32-sh.c"
Index: bfd/elf32-sh-nbsd.c
===================================================================
RCS file: bfd/elf32-sh-nbsd.c
diff -N bfd/elf32-sh-nbsd.c
--- bfd/elf32-sh-nbsd.c	8 Jan 2002 04:22:52 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,29 +0,0 @@
-/* Hitachi SH specific support for 32-bit NetBSD
-   Copyright 2002 Free Software Foundation, Inc.
-
-This file is part of BFD, the Binary File Descriptor library.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define TARGET_BIG_SYM bfd_elf32_shnbsd_vec
-#define TARGET_BIG_NAME "elf32-sh-nbsd"
-#define TARGET_LITTLE_SYM bfd_elf32_shlnbsd_vec
-#define TARGET_LITTLE_NAME "elf32-shl-nbsd"
-#define ELF_ARCH bfd_arch_sh
-#define ELF_MACHINE_CODE EM_SH
-#define ELF_MAXPAGESIZE 0x10000
-#define elf_symbol_leading_char 0
-
-#include "elf32-sh.c"
Index: bfd/elf32-sh.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-sh.c,v
retrieving revision 1.63
diff -u -p -r1.63 elf32-sh.c
--- bfd/elf32-sh.c	14 Oct 2002 19:29:54 -0000	1.63
+++ bfd/elf32-sh.c	16 Oct 2002 08:18:43 -0000
@@ -105,6 +105,10 @@ static enum elf_reloc_type_class sh_elf_
 #ifdef INCLUDE_SHMEDIA
 inline static void movi_shori_putval PARAMS ((bfd *, unsigned long, char *));
 #endif
+static boolean elf32_shlin_grok_prstatus
+  PARAMS ((bfd *abfd, Elf_Internal_Note *note));
+static boolean elf32_shlin_grok_psinfo
+  PARAMS ((bfd *abfd, Elf_Internal_Note *note));
 
 /* The name of the dynamic interpreter.  This is put in the .interp
    section.  */
@@ -7324,7 +7328,71 @@ sh_elf_reloc_type_class (rela)
     }
 }
 
-#ifndef ELF_ARCH
+/* Support for Linux core dump NOTE sections */
+static boolean
+elf32_shlin_grok_prstatus (abfd, note)
+     bfd *abfd;
+     Elf_Internal_Note *note;
+{
+  int offset;
+  unsigned int raw_size;
+
+  switch (note->descsz)
+    {
+      default:
+	return false;
+
+      case 168:		/* Linux/SH */
+	/* pr_cursig */
+	elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+
+	/* pr_pid */
+	elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24);
+
+	/* pr_reg */
+	offset = 72;
+	raw_size = 92;
+
+	break;
+    }
+
+  /* Make a ".reg/999" section.  */
+  return _bfd_elfcore_make_pseudosection (abfd, ".reg",
+					  raw_size, note->descpos + offset);
+}
+
+static boolean
+elf32_shlin_grok_psinfo (abfd, note)
+     bfd *abfd;
+     Elf_Internal_Note *note;
+{
+  switch (note->descsz)
+    {
+      default:
+	return false;
+
+      case 124:		/* Linux/SH elf_prpsinfo */
+	elf_tdata (abfd)->core_program
+	 = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
+	elf_tdata (abfd)->core_command
+	 = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
+    }
+
+  /* Note that for some reason, a spurious space is tacked
+     onto the end of the args in some (at least one anyway)
+     implementations, so strip it off if it exists.  */
+
+  {
+    char *command = elf_tdata (abfd)->core_command;
+    int n = strlen (command);
+
+    if (0 < n && command[n - 1] == ' ')
+      command[n - 1] = '\0';
+  }
+
+  return true;
+}
+
 #define TARGET_BIG_SYM		bfd_elf32_sh_vec
 #define TARGET_BIG_NAME		"elf32-sh"
 #define TARGET_LITTLE_SYM	bfd_elf32_shl_vec
@@ -7334,7 +7402,6 @@ sh_elf_reloc_type_class (rela)
 #define ELF_MAXPAGESIZE		128
 
 #define elf_symbol_leading_char '_'
-#endif /* ELF_ARCH */
 
 #define bfd_elf32_bfd_reloc_type_lookup	sh_elf_reloc_type_lookup
 #define elf_info_to_howto		sh_elf_info_to_howto
@@ -7378,7 +7445,74 @@ sh_elf_reloc_type_class (rela)
 #define elf_backend_got_header_size	12
 #define elf_backend_plt_header_size	PLT_ENTRY_SIZE
 
-#ifndef ELF32_SH_C_INCLUDED
+#ifndef INCLUDE_SHMEDIA
+
 #include "elf32-target.h"
-#endif
 
+/* QNX support.  */
+#include "elf32-qnx.h"
+
+#undef	TARGET_LITTLE_SYM 
+#define	TARGET_LITTLE_SYM		bfd_elf32_shlqnx_vec
+#undef	TARGET_LITTLE_NAME
+#define	TARGET_LITTLE_NAME		"elf32-shl-nto"
+#undef	TARGET_BIG_SYM
+#define	TARGET_BIG_SYM			bfd_elf32_shqnx_vec
+#undef	TARGET_BIG_NAME
+#define	TARGET_BIG_NAME			"elf32-sh-nto"
+#undef	ELF_MAXPAGESIZE
+#define	ELF_MAXPAGESIZE			0x1000
+
+#define	elf32_bed			elf32_sh_qnx_bed
+
+#include "elf32-target.h"
+
+#undef	elf_backend_set_nonloadable_filepos
+#undef	elf_backend_is_contained_by_filepos
+#undef	elf_backend_copy_private_bfd_data_p
+#undef	elf32_bed
+
+/* NetBSD support.  */
+#undef	TARGET_BIG_SYM
+#define	TARGET_BIG_SYM			bfd_elf32_shnbsd_vec
+#undef	TARGET_BIG_NAME
+#define	TARGET_BIG_NAME			"elf32-sh-nbsd"
+#undef	TARGET_LITTLE_SYM
+#define	TARGET_LITTLE_SYM		bfd_elf32_shlnbsd_vec
+#undef	TARGET_LITTLE_NAME
+#define	TARGET_LITTLE_NAME		"elf32-shl-nbsd"
+#undef	ELF_MAXPAGESIZE
+#define	ELF_MAXPAGESIZE			0x10000
+#undef	elf_symbol_leading_char
+#define	elf_symbol_leading_char		0
+
+#define	elf32_bed			elf32_sh_nbsd_bed
+
+#include "elf32-target.h"
+
+#undef	elf32_bed
+
+/* Linux support.  */
+#undef	TARGET_BIG_SYM
+#define	TARGET_BIG_SYM			bfd_elf32_shblin_vec
+#undef	TARGET_BIG_NAME
+#define	TARGET_BIG_NAME			"elf32-shbig-linux"
+#undef	TARGET_LITTLE_SYM
+#define	TARGET_LITTLE_SYM		bfd_elf32_shlin_vec
+#undef	TARGET_LITTLE_NAME
+#define	TARGET_LITTLE_NAME		"elf32-sh-linux"
+
+#undef	elf_backend_grok_prstatus
+#define	elf_backend_grok_prstatus	elf32_shlin_grok_prstatus
+#undef	elf_backend_grok_psinfo
+#define	elf_backend_grok_psinfo		elf32_shlin_grok_psinfo
+
+#define	elf32_bed			elf32_sh_lin_bed
+
+#include "elf32-target.h"
+
+#undef	elf_backend_grok_prstatus
+#undef	elf_backend_grok_psinfo
+#undef	elf32_bed
+
+#endif /* INCLUDE_SHMEDIA */
Index: bfd/elf32-sh64-lin.c
===================================================================
RCS file: bfd/elf32-sh64-lin.c
diff -N bfd/elf32-sh64-lin.c
--- bfd/elf32-sh64-lin.c	9 Oct 2002 19:03:57 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,29 +0,0 @@
-/* Hitachi SH specific support for 64-bit Linux
-   Copyright 2000 Free Software Foundation, Inc.
-
-This file is part of BFD, the Binary File Descriptor library.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define TARGET_BIG_SYM bfd_elf32_sh64blin_vec
-#define TARGET_BIG_NAME "elf32-sh64big-linux"
-#define TARGET_LITTLE_SYM bfd_elf32_sh64lin_vec
-#define TARGET_LITTLE_NAME "elf32-sh64-linux"
-#define ELF_ARCH bfd_arch_sh
-#define ELF_MACHINE_CODE EM_SH
-#define ELF_MAXPAGESIZE 0x10000
-#define elf_symbol_leading_char 0
-
-#include "elf32-sh64.c"
Index: bfd/elf32-sh64-nbsd.c
===================================================================
RCS file: bfd/elf32-sh64-nbsd.c
diff -N bfd/elf32-sh64-nbsd.c
--- bfd/elf32-sh64-nbsd.c	4 Jun 2002 02:57:38 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,29 +0,0 @@
-/* SuperH SH64 specific support for 32-bit NetBSD
-   Copyright 2002 Free Software Foundation, Inc.
-
-This file is part of BFD, the Binary File Descriptor library.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define TARGET_BIG_SYM		bfd_elf32_sh64nbsd_vec
-#define TARGET_BIG_NAME		"elf32-sh64-nbsd"
-#define TARGET_LITTLE_SYM	bfd_elf32_sh64lnbsd_vec
-#define TARGET_LITTLE_NAME	"elf32-sh64l-nbsd"
-#define ELF_ARCH		bfd_arch_sh
-#define ELF_MACHINE_CODE	EM_SH
-#define ELF_MAXPAGESIZE		0x10000
-#define elf_symbol_leading_char	0
-
-#include "elf32-sh64.c"
Index: bfd/elf32-sh64.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-sh64.c,v
retrieving revision 1.8
diff -u -p -r1.8 elf32-sh64.c
--- bfd/elf32-sh64.c	11 Oct 2002 08:33:11 -0000	1.8
+++ bfd/elf32-sh64.c	16 Oct 2002 06:23:03 -0000
@@ -89,18 +89,6 @@ static void sh64_find_section_for_addres
    define it true here.  */
 #define _bfd_sh_align_load_span(a,b,c,d,e,f,g,h,i,j) true
 
-#ifndef ELF_ARCH
-#define TARGET_BIG_SYM		bfd_elf32_sh64_vec
-#define TARGET_BIG_NAME		"elf32-sh64"
-#define TARGET_LITTLE_SYM	bfd_elf32_sh64l_vec
-#define TARGET_LITTLE_NAME	"elf32-sh64l"
-#define ELF_ARCH		bfd_arch_sh
-#define ELF_MACHINE_CODE	EM_SH
-#define ELF_MAXPAGESIZE		128
-
-#define elf_symbol_leading_char '_'
-#endif /* ELF_ARCH */
-
 #define GOT_BIAS (-((long)-32768))
 #define INCLUDE_SHMEDIA
 #include "elf32-sh.c"
@@ -745,3 +733,50 @@ sh64_elf_final_write_processing (abfd, l
 	}
     }
 }
+
+#undef	TARGET_BIG_SYM
+#define	TARGET_BIG_SYM		bfd_elf32_sh64_vec
+#undef	TARGET_BIG_NAME
+#define	TARGET_BIG_NAME		"elf32-sh64"
+#undef	TARGET_LITTLE_SYM
+#define	TARGET_LITTLE_SYM	bfd_elf32_sh64l_vec
+#undef	TARGET_LITTLE_NAME
+#define	TARGET_LITTLE_NAME	"elf32-sh64l"
+
+#include "elf32-target.h"
+
+/* NetBSD support.  */
+#undef	TARGET_BIG_SYM
+#define	TARGET_BIG_SYM		bfd_elf32_sh64nbsd_vec
+#undef	TARGET_BIG_NAME
+#define	TARGET_BIG_NAME		"elf32-sh64-nbsd"
+#undef	TARGET_LITTLE_SYM
+#define	TARGET_LITTLE_SYM	bfd_elf32_sh64lnbsd_vec
+#undef	TARGET_LITTLE_NAME
+#define	TARGET_LITTLE_NAME	"elf32-sh64l-nbsd"
+#undef	ELF_MAXPAGESIZE
+#define	ELF_MAXPAGESIZE		0x10000
+#undef	elf_symbol_leading_char
+#define	elf_symbol_leading_char	0
+
+#define	elf32_bed		elf32_sh64_nbsd_bed
+
+#include "elf32-target.h"
+
+#undef	elf32_bed
+
+/* Linux support.  */
+#undef	TARGET_BIG_SYM
+#define	TARGET_BIG_SYM		bfd_elf32_sh64blin_vec
+#undef	TARGET_BIG_NAME
+#define	TARGET_BIG_NAME		"elf32-sh64big-linux"
+#undef	TARGET_LITTLE_SYM
+#define	TARGET_LITTLE_SYM	bfd_elf32_sh64lin_vec
+#undef	TARGET_LITTLE_NAME
+#define	TARGET_LITTLE_NAME	"elf32-sh64-linux"
+
+#define	elf32_bed		elf32_sh64_lin_bed
+
+#include "elf32-target.h"
+
+#undef	elf32_bed
Index: bfd/elf32-shqnx.c
===================================================================
RCS file: bfd/elf32-shqnx.c
diff -N bfd/elf32-shqnx.c
--- bfd/elf32-shqnx.c	16 Oct 2002 00:56:41 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,34 +0,0 @@
-/* Hitachi SH QNX specific support for 32-bit ELF
-   Copyright 2002   Free Software Foundation, Inc.
-
-   This file is part of BFD, the Binary File Descriptor library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define ELF32_SH_C_INCLUDED
-#include "elf32-sh.c"
-
-#include "elf32-qnx.h"
-
-#undef  TARGET_LITTLE_SYM 
-#define TARGET_LITTLE_SYM       bfd_elf32_shlqnx_vec
-#undef  TARGET_LITTLE_NAME
-#define TARGET_LITTLE_NAME	"elf32-shl-nto"
-#undef  TARGET_BIG_SYM
-#define TARGET_BIG_SYM          bfd_elf32_shqnx_vec
-#undef  TARGET_BIG_NAME
-#define TARGET_BIG_NAME		"elf32-sh-nto"
-
-#include "elf32-target.h"
Index: bfd/elf64-sh64-lin.c
===================================================================
RCS file: bfd/elf64-sh64-lin.c
diff -N bfd/elf64-sh64-lin.c
--- bfd/elf64-sh64-lin.c	9 Oct 2002 19:03:57 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,29 +0,0 @@
-/* Hitachi SH specific support for 64-bit Linux
-   Copyright 2002 Free Software Foundation, Inc.
-
-This file is part of BFD, the Binary File Descriptor library.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define TARGET_BIG_SYM bfd_elf64_sh64blin_vec
-#define TARGET_BIG_NAME "elf64-sh64big-linux"
-#define TARGET_LITTLE_SYM bfd_elf64_sh64lin_vec
-#define TARGET_LITTLE_NAME "elf64-sh64-linux"
-#define ELF_ARCH bfd_arch_sh
-#define ELF_MACHINE_CODE EM_SH
-#define ELF_MAXPAGESIZE 0x10000
-#define elf_symbol_leading_char 0
-
-#include "elf64-sh64.c"
Index: bfd/elf64-sh64-nbsd.c
===================================================================
RCS file: bfd/elf64-sh64-nbsd.c
diff -N bfd/elf64-sh64-nbsd.c
--- bfd/elf64-sh64-nbsd.c	4 Jun 2002 02:57:38 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,29 +0,0 @@
-/* SuperH SH64 specific support for 64-bit NetBSD
-   Copyright 2002 Free Software Foundation, Inc.
-
-This file is part of BFD, the Binary File Descriptor library.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define TARGET_BIG_SYM		bfd_elf64_sh64nbsd_vec
-#define TARGET_BIG_NAME		"elf64-sh64-nbsd"
-#define TARGET_LITTLE_SYM	bfd_elf64_sh64lnbsd_vec
-#define TARGET_LITTLE_NAME	"elf64-sh64l-nbsd"
-#define ELF_ARCH		bfd_arch_sh
-#define ELF_MACHINE_CODE	EM_SH
-#define ELF_MAXPAGESIZE		0x10000
-#define elf_symbol_leading_char	0
-
-#include "elf64-sh64.c"
Index: bfd/elf64-sh64.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-sh64.c,v
retrieving revision 1.21
diff -u -p -r1.21 elf64-sh64.c
--- bfd/elf64-sh64.c	11 Oct 2002 08:33:11 -0000	1.21
+++ bfd/elf64-sh64.c	16 Oct 2002 06:23:14 -0000
@@ -4129,8 +4129,6 @@ sh64_elf64_finish_dynamic_sections (outp
   return true;
 }
 
-
-#ifndef ELF_ARCH
 #define TARGET_BIG_SYM		bfd_elf64_sh64_vec
 #define TARGET_BIG_NAME		"elf64-sh64"
 #define TARGET_LITTLE_SYM	bfd_elf64_sh64l_vec
@@ -4140,7 +4138,6 @@ sh64_elf64_finish_dynamic_sections (outp
 #define ELF_MAXPAGESIZE		128
 
 #define elf_symbol_leading_char '_'
-#endif /* ELF_ARCH */
 
 #define bfd_elf64_bfd_reloc_type_lookup	sh_elf64_reloc_type_lookup
 #define elf_info_to_howto		sh_elf64_info_to_howto
@@ -4194,4 +4191,35 @@ sh64_elf64_finish_dynamic_sections (outp
 #define elf_backend_got_header_size	24
 #define elf_backend_plt_header_size	PLT_ENTRY_SIZE
 
+#include "elf64-target.h"
+
+/* NetBSD support.  */
+#undef	TARGET_BIG_SYM
+#define	TARGET_BIG_SYM			bfd_elf64_sh64nbsd_vec
+#undef	TARGET_BIG_NAME
+#define	TARGET_BIG_NAME			"elf64-sh64-nbsd"
+#undef	TARGET_LITTLE_SYM
+#define	TARGET_LITTLE_SYM		bfd_elf64_sh64lnbsd_vec
+#undef	TARGET_LITTLE_NAME
+#define	TARGET_LITTLE_NAME		"elf64-sh64l-nbsd"
+#undef	ELF_MAXPAGESIZE
+#define	ELF_MAXPAGESIZE			0x10000
+#undef	elf_symbol_leading_char
+#define	elf_symbol_leading_char		0
+
+#define	elf64_bed			elf64_sh64_nbsd_bed
+
+#include "elf64-target.h"
+
+/* Linux support.  */
+#undef	TARGET_BIG_SYM
+#define	TARGET_BIG_SYM			bfd_elf64_sh64blin_vec
+#undef	TARGET_BIG_NAME
+#define	TARGET_BIG_NAME			"elf64-sh64big-linux"
+#undef	TARGET_LITTLE_SYM
+#define	TARGET_LITTLE_SYM		bfd_elf64_sh64lin_vec
+#undef	TARGET_LITTLE_NAME
+#define	TARGET_LITTLE_NAME		"elf64-sh64-linux"
+
+#define	INCLUDED_TARGET_FILE
 #include "elf64-target.h"
Index: bfd/elfarm-nabi.c
===================================================================
RCS file: /cvs/src/src/bfd/elfarm-nabi.c,v
retrieving revision 1.12
diff -u -p -r1.12 elfarm-nabi.c
--- bfd/elfarm-nabi.c	30 Jul 2002 17:32:26 -0000	1.12
+++ bfd/elfarm-nabi.c	16 Oct 2002 06:23:14 -0000
@@ -749,6 +749,27 @@ elf32_arm_nabi_grok_psinfo (abfd, note)
 #define elf_backend_grok_prstatus	elf32_arm_nabi_grok_prstatus
 #define elf_backend_grok_psinfo		elf32_arm_nabi_grok_psinfo
 
-#ifndef ELFARM_NABI_C_INCLUDED
 #include "elf32-arm.h"
-#endif
+
+/* QNX support.  */
+#include "elf32-qnx.h"
+
+#undef	TARGET_LITTLE_SYM 
+#define	TARGET_LITTLE_SYM		bfd_elf32_littlearmqnx_vec
+#undef	TARGET_LITTLE_NAME
+#define	TARGET_LITTLE_NAME		"elf32-littlearm-nto"
+#undef	TARGET_BIG_SYM
+#define	TARGET_BIG_SYM			bfd_elf32_bigarmqnx_vec
+#undef	TARGET_BIG_NAME
+#define	TARGET_BIG_NAME			"elf32-bigarm-nto"
+#undef	ELF_MAXPAGESIZE
+#define	ELF_MAXPAGESIZE			0x1000
+
+#define	elf32_bed			elf32_arm_qnx_bed
+
+#include "elf32-target.h"
+
+#undef	elf_backend_set_nonloadable_filepos
+#undef	elf_backend_is_contained_by_filepos
+#undef	elf_backend_copy_private_bfd_data_p
+#undef	elf32_bed
Index: bfd/elfarmqnx-nabi.c
===================================================================
RCS file: bfd/elfarmqnx-nabi.c
diff -N bfd/elfarmqnx-nabi.c
--- bfd/elfarmqnx-nabi.c	16 Oct 2002 00:56:41 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,38 +0,0 @@
-/* ARM new abi QNX specific support for 32-bit ELF
-   Copyright 2002   Free Software Foundation, Inc.
-
-   This file is part of BFD, the Binary File Descriptor library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define ELFARM_NABI_C_INCLUDED
-#include "elfarm-nabi.c"
-
-#include "elf32-qnx.h"
-
-#undef  TARGET_LITTLE_SYM 
-#define TARGET_LITTLE_SYM       bfd_elf32_littlearmqnx_vec
-#undef  TARGET_LITTLE_NAME
-#define TARGET_LITTLE_NAME	"elf32-littlearm-nto"
-#undef  TARGET_BIG_SYM
-#define TARGET_BIG_SYM          bfd_elf32_bigarmqnx_vec
-#undef  TARGET_BIG_NAME
-#define TARGET_BIG_NAME		"elf32-bigarm-nto"
-
-/* QNX Neutrino for ARM has a max pagesize of 0x1000.  */
-#undef  ELF_MAXPAGESIZE
-#define ELF_MAXPAGESIZE 	0x1000
-
-#include "elf32-arm.h"

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]