[PATCH/RFA] Add sh5*-*-netbsd* and sh64*-*-netbsd* targets

Jason R Thorpe thorpej@wasabisystems.com
Mon Jun 3 10:40:00 GMT 2002


The 4 targets added are:

	sh5-*-netbsd*		SH5, big-endian, 32-bit default
	sh5l-*-netbsd*		SH5, little-endian, 32-bit default

	sh64-*-netbsd*		SH5, big-endian, 64-bit default
	sh64l-*-netbsd*		SH5, little-endian, 64-bit default

Changes to config.sub are also needed, will be submitted to config-patches
separately.

I'm particularly interested in a sanity-check on the change to tc-sh64.h.
Without that change, I get a "redefined" warning for that macro (the
original definition comes from tc-sh.h).

Also, bfd/targets.c listed the existing sh64 vectors, but didn't actually
put them in the targets array.  I did the same thing with the new sh64_nbsd
vectors.  What's the right thing to do, here?

The new elf{32,64}-sh64{,l}-nbsd vectors are needed, because NetBSD
does not use a leading underscore for user-visible symbols (this matches
the elf32-sh-nbsd behavior).

OK to commit?

bfd/
	* Makefile.am (BFD32_BACKENDS): Add elf32-sh64-nbsd.lo.
	(BFD32_BACKENDS_CFILES): Add elf32-sh64-nbsd.c.
	(BFD64_BACKENDS): Add elf64-sh64-nbsd.lo.
	(BFD64_BACKENDS_CFILES): Add elf64-sh64-nbsd.c.
	(elf32-sh64-nbsd.lo)
	(elf64-sh64-nbsd.lo): New rules.
	* Makefile.in: Regenerate.
	* config.bfd (sh5le-*-netbsd*)
	(sh5-*-netbsd*)
	(sh64le-*-netbsd*)
	(sh64-*-netbsd*): New targets.
	* configure.in: Add bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec,
	bfd_elf64_sh64nbsd_vec, and bfd_elf64_sh64lnbsd_vec.
	* configure: Regenerate.
	* elf32-sh64-nbsd.c: New file.
	* elf64-sh64-nbsd.c: New file.
	* targets.c: Add extern decls for bfd_elf32_sh64nbsd_vec,
	bfd_elf32_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec, and
	bfd_elf64_sh64lnbsd_vec.

gas/
	* configure.in (sh5*): Set cpu_type to sh64 and endian to big.
	(sh5le*)
	(sh64le*): Set cpu_type to sh64 and endian to little.
	(sh5*-*-netbsd*)
	(sh64*-*-netbsd*): New targets.
	* configure: Regenerate.
	* config/tc-sh64.c (sh64_target_format): Add support for NetBSD
	environment.
	* config/tc-sh64.h (MD_PCREL_FROM_SECTION): Undef before redefining.

ld/
	* Makefile.am (ALL_EMULATIONS): Add eshelf32_nbsd.o,
	eshlelf32_nbsd.o, eshelf64_nbsd.o, and eshlelf64_nbsd.o
	(eshelf32_nbsd.c)
	(eshelf64_nbsd.c)
	(eshlelf32_nbsd.c)
	(eshlelf64_nbsd.c): New rules.
	* Makefile.in: Regenerate.
	* configure.tgt (sh5le-*-netbsd*)
	(sh5-*-netbsd*)
	(sh64le-*-netbsd*)
	(sh64-*-netbsd*): New targets.
	* emulparams/shelf32_nbsd.sh: New file.
	* emulparams/shelf64_nbsd.sh: New file.
	* emulparams/shlelf32_nbsd.sh: New file.
	* emulparams/shlelf64_nbsd.sh: New file.

opcodes/
	* configure.in: Add "sh5*-*" to list of targets which include
	sh64 support.
	* configure: Regenerate.

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>
-------------- next part --------------
Index: bfd/Makefile.am
===================================================================
RCS file: /cvs/src/src/bfd/Makefile.am,v
retrieving revision 1.86
diff -u -r1.86 Makefile.am
--- bfd/Makefile.am	31 May 2002 02:59:44 -0000	1.86
+++ bfd/Makefile.am	3 Jun 2002 17:01:38 -0000
@@ -230,6 +230,7 @@
 	elf32-sh-lin.lo \
 	elf32-sh64.lo \
 	elf32-sh-nbsd.lo \
+	elf32-sh64-nbsd.lo \
 	elf32-sparc.lo \
 	elf32-v850.lo \
 	elf32-vax.lo \
@@ -381,6 +382,7 @@
 	elf32-sh.c \
 	elf32-sh-lin.c \
 	elf32-sh-nbsd.c \
+	elf32-sh64-nbsd.c \
 	elf32-sparc.c \
 	elf32-v850.c \
 	elf32-vax.c \
@@ -467,6 +469,7 @@
 	elf64-mips.lo \
 	elf64-mmix.lo \
 	elf64-sh64.lo \
+	elf64-sh64-nbsd.lo \
 	elf64-ppc.lo \
 	elf64-s390.lo \
 	elf64-sparc.lo \
@@ -492,6 +495,7 @@
 	elf64-ppc.c \
 	elf64-s390.c \
 	elf64-sh64.c \
+	elf64-sh64-nbsd.c \
 	elf64-sparc.c \
 	elf64.c \
 	mmo.c \
@@ -1193,6 +1197,11 @@
   $(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \
   elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
   elf32-target.h
+elf32-sh64-nbsd.lo: elf32-sh64-nbsd.c $(INCDIR)/filenames.h elf-bfd.h \
+  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+  $(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \
+  elf32-sh64.c elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
+  elf32-target.h
 elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \
@@ -1482,6 +1491,10 @@
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
   elf64-target.h
+elf64-sh64-nbsd.lo: elf64-sh64-nbsd.c $(INCDIR)/filenames.h \
+  $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
+  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \
+  $(INCDIR)/elf/reloc-macros.h elf64-sh64.c elf64-target.h
 elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/sparc.h \
Index: bfd/config.bfd
===================================================================
RCS file: /cvs/src/src/bfd/config.bfd,v
retrieving revision 1.97
diff -u -r1.97 config.bfd
--- bfd/config.bfd	31 May 2002 02:59:46 -0000	1.97
+++ bfd/config.bfd	3 Jun 2002 17:02:02 -0000
@@ -905,6 +905,26 @@
     targ_defvec=bfd_elf32_shlin_vec
     ;;
 
+#ifdef BFD64
+  sh5le-*-netbsd*)
+    targ_defvec=bfd_elf32_sh64lnbsd_vec
+    targ_selvecs="bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec"
+    ;;
+  sh5-*-netbsd*)
+    targ_defvec=bfd_elf32_sh64nbsd_vec
+    targ_selvecs="bfd_elf32_sh64lnbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec"
+    ;;
+
+  sh64le-*-netbsd*)
+    targ_defvec=bfd_elf64_sh64lnbsd_vec
+    targ_selvecs="bfd_elf64_sh64nbsd_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec"
+    ;;
+  sh64-*-netbsd*)
+    targ_defvec=bfd_elf64_sh64nbsd_vec
+    targ_selvecs="bfd_elf64_sh64lnbsd_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec"
+    ;;
+#endif
+
   shle-*-netbsdelf*)
     targ_defvec=bfd_elf32_shlnbsd_vec
     targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec"
Index: bfd/configure.in
===================================================================
RCS file: /cvs/src/src/bfd/configure.in,v
retrieving revision 1.98
diff -u -r1.98 configure.in
--- bfd/configure.in	31 May 2002 02:59:46 -0000	1.98
+++ bfd/configure.in	3 Jun 2002 17:02:16 -0000
@@ -613,6 +613,10 @@
     bfd_elf32_sh64l_vec)	tb="$tb elf32-sh64.lo elf32.lo $elf cofflink.lo" 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_elf32_sh64nbsd_vec)	tb="$tb elf32-sh64-nbsd.lo elf32.lo $elf cofflink.lo" ;;
+    bfd_elf32_sh64lnbsd_vec)	tb="$tb elf32-sh64-nbsd.lo elf32.lo $elf cofflink.lo" ;;
+    bfd_elf64_sh64nbsd_vec)	tb="$tb elf64-sh64-nbsd.lo elf64.lo $elf" target_size=64 ;;
+    bfd_elf64_sh64lnbsd_vec)	tb="$tb elf64-sh64-nbsd.lo elf64.lo $elf" target_size=64 ;;
     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" ;;
Index: bfd/elf32-sh64-nbsd.c
===================================================================
RCS file: bfd/elf32-sh64-nbsd.c
diff -N bfd/elf32-sh64-nbsd.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ bfd/elf32-sh64-nbsd.c	3 Jun 2002 17:02:18 -0000
@@ -0,0 +1,29 @@
+/* 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/elf64-sh64-nbsd.c
===================================================================
RCS file: bfd/elf64-sh64-nbsd.c
diff -N bfd/elf64-sh64-nbsd.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ bfd/elf64-sh64-nbsd.c	3 Jun 2002 17:02:18 -0000
@@ -0,0 +1,29 @@
+/* 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/targets.c
===================================================================
RCS file: /cvs/src/src/bfd/targets.c,v
retrieving revision 1.63
diff -u -r1.63 targets.c
--- bfd/targets.c	31 May 2002 02:59:47 -0000	1.63
+++ bfd/targets.c	3 Jun 2002 17:02:20 -0000
@@ -698,6 +698,11 @@
 extern const bfd_target bfd_elf32_sh64l_vec;
 extern const bfd_target bfd_elf64_sh64_vec;
 extern const bfd_target bfd_elf64_sh64l_vec;
+
+extern const bfd_target bfd_elf32_sh64nbsd_vec;
+extern const bfd_target bfd_elf32_sh64lnbsd_vec;
+extern const bfd_target bfd_elf64_sh64nbsd_vec;
+extern const bfd_target bfd_elf64_sh64lnbsd_vec;
 static const bfd_target * const _bfd_target_vector[] = {
 
 #ifdef SELECT_VECS
Index: gas/configure.in
===================================================================
RCS file: /cvs/src/src/gas/configure.in,v
retrieving revision 1.105
diff -u -r1.105 configure.in
--- gas/configure.in	31 May 2002 03:00:58 -0000	1.105
+++ gas/configure.in	3 Jun 2002 17:02:47 -0000
@@ -145,7 +145,10 @@
       rs6000*)		cpu_type=ppc ;;
       s390x*)		cpu_type=s390 arch=s390x ;;
       s390*)		cpu_type=s390 arch=s390 ;;
-      sh64*)            cpu_type=sh64 endian=big;;
+      sh5*)		cpu_type=sh64 endian=big ;;
+      sh5le*)		cpu_type=sh64 endian=little ;;
+      sh64*)            cpu_type=sh64 endian=big ;;
+      sh64le*)		cpu_type=sh64 endian=little ;;
       sh*le)		cpu_type=sh endian=little ;;
       sh*)		cpu_type=sh endian=big ;;
       sparclite*)	cpu_type=sparc arch=sparclite ;;
@@ -424,6 +427,8 @@
 				sh*)
 					endian=little ;;
 			    esac ;;
+      sh5*-*-netbsd*)       fmt=elf em=nbsd ;;
+      sh64*-*-netbsd*)      fmt=elf em=nbsd ;;
       sh*-*-netbsdelf*)     fmt=elf em=nbsd ;;
       sh-*-elf*)	    fmt=elf ;;
       sh-*-coff*)           fmt=coff ;;
Index: gas/config/tc-sh64.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-sh64.c,v
retrieving revision 1.2
diff -u -r1.2 tc-sh64.c
--- gas/config/tc-sh64.c	11 May 2002 09:53:50 -0000	1.2
+++ gas/config/tc-sh64.c	3 Jun 2002 17:02:59 -0000
@@ -2948,6 +2948,24 @@
   return "FIXME: No linux target yet";
 #endif
 
+#ifdef TE_NetBSD
+  /* For NetBSD, if the ISA is unspecified, always use SHmedia.  */
+  if (sh64_isa_mode == sh64_isa_unspecified)
+    sh64_isa_mode = sh64_isa_shmedia;
+
+  /* If the ABI is unspecified, select a default: based on how
+     we were configured: sh64 == sh64_abi_64, else sh64_abi_32.  */
+  if (sh64_abi == sh64_abi_unspecified)
+    {
+      if (sh64_isa_mode == sh64_isa_shcompact)
+	sh64_abi = sh64_abi_32;
+      else if (strncmp (TARGET_CPU, "sh64", 4) == 0)
+        sh64_abi = sh64_abi_64;
+      else
+        sh64_abi = sh64_abi_32;
+    }
+#endif
+
   if (sh64_abi == sh64_abi_64 && sh64_isa_mode == sh64_isa_unspecified)
     sh64_isa_mode = sh64_isa_shmedia;
 
@@ -2979,6 +2997,12 @@
   if (sh64_pt32 && ! sh64_expand)
     as_bad (_("-expand-pt32 invalid together with -no-expand"));
 
+#ifdef TE_NetBSD
+  if (sh64_abi == sh64_abi_64)
+    return (target_big_endian ? "elf64-sh64-nbsd" : "elf64-sh64l-nbsd");
+  else
+    return (target_big_endian ? "elf32-sh64-nbsd" : "elf32-sh64l-nbsd");
+#else
   /* When the ISA is not one of SHmedia or SHcompact, use the old SH
      object format.  */
   if (sh64_isa_mode == sh64_isa_unspecified)
@@ -2987,6 +3011,7 @@
     return (target_big_endian ? "elf64-sh64" : "elf64-sh64l");
   else
     return (target_big_endian ? "elf32-sh64" : "elf32-sh64l");
+#endif
 }
 
 /* The worker function of TARGET_MACH.  */
Index: gas/config/tc-sh64.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-sh64.h,v
retrieving revision 1.1
diff -u -r1.1 tc-sh64.h
--- gas/config/tc-sh64.h	8 Feb 2002 06:32:20 -0000	1.1
+++ gas/config/tc-sh64.h	3 Jun 2002 17:02:59 -0000
@@ -119,6 +119,7 @@
 /* Saying "$" is the same as saying ".".  */
 #define DOLLAR_DOT
 
+#undef MD_PCREL_FROM_SECTION
 #define MD_PCREL_FROM_SECTION(FIXP, SEC)		\
   shmedia_md_pcrel_from_section (FIXP, SEC)
 
Index: ld/Makefile.am
===================================================================
RCS file: /cvs/src/src/ld/Makefile.am,v
retrieving revision 1.100
diff -u -r1.100 Makefile.am
--- ld/Makefile.am	31 May 2002 03:02:34 -0000	1.100
+++ ld/Makefile.am	3 Jun 2002 17:03:07 -0000
@@ -252,6 +252,8 @@
 	esh.o \
 	eshelf32.o \
 	eshlelf32.o \
+	eshelf32_nbsd.o \
+	eshlelf32_nbsd.o \
 	eshelf.o \
 	eshelf_linux.o \
 	eshlelf_linux.o \
@@ -285,6 +287,8 @@
 	eelf64_ia64_fbsd.o \
 	eshelf64.o \
 	eshlelf64.o \
+	eshelf64_nbsd.o \
+	eshlelf64_nbsd.o \
 	eelf_x86_64.o \
 	eelf_x86_64_fbsd.o \
 	eelf64_s390.o \
@@ -940,9 +944,19 @@
   $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} shelf32 "$(tdir_shelf32)"
+eshelf32_nbsd.c: $(srcdir)/emulparams/shelf32_nbsd.sh \
+  $(srcdir)/emulparams/shelf32.sh \
+  $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
+  $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} shelf32_nbsd "$(tdir_shelf32_nbsd)"
 eshelf64.c: $(srcdir)/emulparams/shelf64.sh $(srcdir)/emulparams/shelf32.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} shelf64 "$(tdir_shelf64)"
+eshelf64_nbsd.c: $(srcdir)/emulparams/shelf64_nbsd.sh \
+  $(srcdir)/emulparams/shelf32_nbsd.sh $(srcdir)/emulparams/shelf32.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} shelf64_nbsd "$(tdir_shelf64_nbsd)"
 eshelf_linux.c: $(srcdir)/emulparams/shelf_linux.sh \
   $(srcdir)/emulparams/shlelf_linux.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -968,10 +982,21 @@
   $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} shlelf32 "$(tdir_shlelf32)"
+eshlelf32_nbsd.c: $(srcdir)/emulparams/shlelf32_nbsd.sh \
+  $(srcdir)/emulparams/shelf32_nbsd.sh $(srcdir)/emulparams/shelf32.sh \
+  $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
+  $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} shlelf32_nbsd "$(tdir_shlelf32_nbsd)"
 eshlelf64.c: $(srcdir)/emulparams/shlelf64.sh \
   $(srcdir)/emulparams/shelf64.sh $(srcdir)/emulparams/shelf32.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} shlelf64 "$(tdir_shlelf64)"
+eshlelf64_nbsd.c: $(srcdir)/emulparams/shlelf64_nbsd.sh \
+  $(srcdir)/emulparams/shelf64_nbsd.sh \
+  $(srcdir)/emulparams/shelf32_nbsd.sh $(srcdir)/emulparams/shelf32.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} shlelf64_nbsd "$(tdir_shlelf64_nbsd)"
 eshl.c: $(srcdir)/emulparams/shl.sh \
   $(srcdir)/emulparams/sh.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
Index: ld/configure.tgt
===================================================================
RCS file: /cvs/src/src/ld/configure.tgt,v
retrieving revision 1.93
diff -u -r1.93 configure.tgt
--- ld/configure.tgt	31 May 2002 03:02:34 -0000	1.93
+++ ld/configure.tgt	3 Jun 2002 17:03:09 -0000
@@ -270,6 +270,22 @@
 sh*-*-linux*)
 			targ_emul=shlelf_linux
 			;;
+sh5le-*-netbsd*)
+			targ_emul=shlelf32_nbsd
+			targ_extra_emuls="shelf32_nbsd shelf64_nbsd shlelf64_nbsd shelf_nbsd shlelf_nbsd"
+			;;
+sh5-*-netbsd*)
+			targ_emul=shelf32_nbsd
+			targ_extra_emuls="shlelf32_nbsd shelf64_nbsd shlelf64_nbsd shelf_nbsd shlelf_nbsd"
+			;;
+sh64le-*-netbsd*)
+			targ_emul=shlelf64_nbsd
+			targ_extra_emuls="shelf64_nbsd shelf32_nbsd shlelf32_nbsd shelf_nbsd shlelf_nbsd"
+			;;
+sh64-*-netbsd*)
+			targ_emul=shelf64_nbsd
+			targ_extra_emuls="shlelf64_nbsd shelf32_nbsd shlelf32_nbsd shelf_nbsd shlelf_nbsd"
+			;;
 sh*le-*-netbsdelf*)
 			targ_emul=shlelf_nbsd
 			targ_extra_emuls=shelf_nbsd
Index: ld/emulparams/shelf32_nbsd.sh
===================================================================
RCS file: ld/emulparams/shelf32_nbsd.sh
diff -N ld/emulparams/shelf32_nbsd.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ld/emulparams/shelf32_nbsd.sh	3 Jun 2002 17:03:10 -0000
@@ -0,0 +1,13 @@
+# If you change this file, please alsolook at files which source this one:
+# shlelf32_nbsd.sh
+
+. ${srcdir}/emulparams/shelf32.sh
+
+OUTPUT_FORMAT="elf32-sh64-nbsd"
+TEXT_START_ADDR=0x400000
+MAXPAGESIZE=0x10000
+
+ENTRY=__start
+
+unset EMBEDDED
+unset STACK_ADDR
Index: ld/emulparams/shelf64_nbsd.sh
===================================================================
RCS file: ld/emulparams/shelf64_nbsd.sh
diff -N ld/emulparams/shelf64_nbsd.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ld/emulparams/shelf64_nbsd.sh	3 Jun 2002 17:03:10 -0000
@@ -0,0 +1,8 @@
+. ${srcdir}/emulparams/shelf32_nbsd.sh
+
+OUTPUT_FORMAT="elf64-sh64-nbsd"
+ELFSIZE=64
+
+# We do not need .cranges
+OTHER_SECTIONS=''
+EXTRA_EM_FILE=
Index: ld/emulparams/shlelf32_nbsd.sh
===================================================================
RCS file: ld/emulparams/shlelf32_nbsd.sh
diff -N ld/emulparams/shlelf32_nbsd.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ld/emulparams/shlelf32_nbsd.sh	3 Jun 2002 17:03:10 -0000
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/shelf32_nbsd.sh
+
+OUTPUT_FORMAT="elf32-sh64l-nbsd"
Index: ld/emulparams/shlelf64_nbsd.sh
===================================================================
RCS file: ld/emulparams/shlelf64_nbsd.sh
diff -N ld/emulparams/shlelf64_nbsd.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ld/emulparams/shlelf64_nbsd.sh	3 Jun 2002 17:03:10 -0000
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/shelf64_nbsd.sh
+
+OUTPUT_FORMAT="elf64-sh64l-nbsd"
Index: opcodes/configure.in
===================================================================
RCS file: /cvs/src/src/opcodes/configure.in,v
retrieving revision 1.37
diff -u -r1.37 configure.in
--- opcodes/configure.in	28 May 2002 14:08:47 -0000	1.37
+++ opcodes/configure.in	3 Jun 2002 17:03:30 -0000
@@ -217,7 +217,7 @@
 	  # Include it just for ELF targets, since the SH5 bfd:s are ELF only.
 	  for t in $target $canon_targets; do
 	    case $t in
-	      all |  sh64-* | sh-*-*elf* | shl-*-*elf* | shle-*-*elf* | \
+	      all |  sh5*-* | sh64*-* | sh-*-*elf* | shl*-*-*elf* | \
 	      sh-*-linux* | shl-*-linux*)
 				ta="$ta sh64-dis.lo sh64-opc.lo"
 				archdefs="$archdefs -DINCLUDE_SHMEDIA"


More information about the Binutils mailing list