This is the mail archive of the binutils@sourceware.cygnus.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]

binutils support for a.out-arm-netbsd target


The following patches relative to the current sourceware binutils 
enable support for the a.out-arm-netbsd (arm-*-netbsd*) target.

I gleaned the few magic bits from the netbsd-current code (which is based
on 2.9.1), and plopped them into the current binutils.  This was enough to
link a.out-arm-netbsd images that the OFW boot loader on DNARDs can boot
properly.  I haven't the foggiest idea if it works for actual netbsd
executables, let alone netbsd/a.out dynamic linking; but those are not my
concern (and evidently the netbsd people don't care either, since they
haven't sent in changes).  We are using an arm-elf development environment
and only need to convert linked kernel images into netbsd a.out format for
the firmware bootloader we are using (DNARD OFW).  For at least that use,
current binutils with these patches seems to be peachy.


Thanks,
Roland


Index: bfd/ChangeLog
===================================================================
RCS file: /cvs/binutils/binutils/bfd/ChangeLog,v
retrieving revision 1.193
diff -u -b -r1.193 ChangeLog
--- bfd/ChangeLog	1999/08/19 13:04:45	1.193
+++ bfd/ChangeLog	1999/08/19 21:52:36
@@ -1,3 +1,13 @@
+1999-08-19  Roland McGrath  <roland@baalperazim.frob.com>
+
+	* config.bfd (arm-*-netbsd*): New target.
+	* configure.in (armnetbsd_vec): New target vector.
+	* targets.c (bfd_target_vector): Add &armnetbsd_vec.
+
+	* Makefile.am (BFD32_BACKENDS): Add armnetbsd.lo.
+	(ALL_MACHINES_CFILES): Add armnetbsd.c.
+	(armnetbsd.lo): New rule with deps.
+
 1999-08-19  Nick Clifton  <nickc@cygnus.com>
 
 	* coff-mcore.c (mcore_emit_base_file_entry): New function:  Emit
Index: bfd/Makefile.am
===================================================================
RCS file: /cvs/binutils/binutils/bfd/Makefile.am,v
retrieving revision 1.7
diff -u -b -r1.7 Makefile.am
--- bfd/Makefile.am	1999/08/08 17:26:50	1.7
+++ bfd/Makefile.am	1999/08/19 21:52:37
@@ -114,6 +114,7 @@
 	aout-tic30.lo \
 	aout0.lo \
 	aout32.lo \
+	armnetbsd.lo \
 	bout.lo \
 	cf-i386lynx.lo \
 	cf-m68klynx.lo \
@@ -236,6 +237,7 @@
 	aout-tic30.c \
 	aout0.c \
 	aout32.c \
+	armnetbsd.c \
 	bout.c \
 	cf-i386lynx.c \
 	cf-m68klynx.c \
@@ -723,6 +725,9 @@
 aout32.lo: aout32.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \
   $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
   $(INCDIR)/aout/ar.h
+armnetbsd.lo: armnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
+  aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+  $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
 bout.lo: bout.c $(INCDIR)/bfdlink.h genlink.h $(INCDIR)/bout.h \
   $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h
 cf-i386lynx.lo: cf-i386lynx.c coff-i386.c $(INCDIR)/coff/i386.h \
Index: bfd/Makefile.in
===================================================================
RCS file: /cvs/binutils/binutils/bfd/Makefile.in,v
retrieving revision 1.8
diff -u -b -r1.8 Makefile.in
--- bfd/Makefile.in	1999/08/09 20:22:03	1.8
+++ bfd/Makefile.in	1999/08/19 21:52:37
@@ -233,6 +233,7 @@
 	aout-tic30.lo \
 	aout0.lo \
 	aout32.lo \
+	armnetbsd.lo \
 	bout.lo \
 	cf-i386lynx.lo \
 	cf-m68klynx.lo \
@@ -356,6 +357,7 @@
 	aout-tic30.c \
 	aout0.c \
 	aout32.c \
+	armnetbsd.c \
 	bout.c \
 	cf-i386lynx.c \
 	cf-m68klynx.c \
@@ -1253,6 +1255,9 @@
 aout32.lo: aout32.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \
   $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
   $(INCDIR)/aout/ar.h
+armnetbsd.lo: armnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
+  aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+  $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
 bout.lo: bout.c $(INCDIR)/bfdlink.h genlink.h $(INCDIR)/bout.h \
   $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h
 cf-i386lynx.lo: cf-i386lynx.c coff-i386.c $(INCDIR)/coff/i386.h \
Index: bfd/config.bfd
===================================================================
RCS file: /cvs/binutils/binutils/bfd/config.bfd,v
retrieving revision 1.9
diff -u -b -r1.9 config.bfd
--- bfd/config.bfd	1999/07/24 02:35:30	1.9
+++ bfd/config.bfd	1999/08/19 21:52:37
@@ -84,6 +84,10 @@
     targ_selvecs=bfd_elf32_bigarc_vec
     ;;
 
+  arm-*-netbsd*)
+    targ_defvec=armnetbsd_vec
+    targ_underscore=yes
+    ;;
   arm-*-riscix*)
     targ_defvec=riscix_vec
     ;;
Index: bfd/configure
===================================================================
RCS file: /cvs/binutils/binutils/bfd/configure,v
retrieving revision 1.7
diff -u -b -r1.7 configure
--- bfd/configure	1999/08/08 16:01:13	1.7
+++ bfd/configure	1999/08/19 21:52:38
@@ -5366,6 +5366,7 @@
     a_out_adobe_vec)		tb="$tb aout-adobe.lo aout32.lo" ;;
     armcoff_little_vec)		tb="$tb coff-arm.lo cofflink.lo " ;;
     armcoff_big_vec)		tb="$tb coff-arm.lo cofflink.lo " ;;
+    armnetbsd_vec)		tb="$tb armnetbsd.lo aout32.lo" ;;
     armpe_little_vec)		tb="$tb pe-arm.lo cofflink.lo " ;;
     armpe_big_vec)		tb="$tb pe-arm.lo cofflink.lo " ;;
     armpei_little_vec)		tb="$tb pei-arm.lo cofflink.lo " ;;
Index: bfd/configure.in
===================================================================
RCS file: /cvs/binutils/binutils/bfd/configure.in,v
retrieving revision 1.5
diff -u -b -r1.5 configure.in
--- bfd/configure.in	1999/07/15 11:48:14	1.5
+++ bfd/configure.in	1999/08/19 21:52:38
@@ -414,6 +414,7 @@
     a_out_adobe_vec)		tb="$tb aout-adobe.lo aout32.lo" ;;
     armcoff_little_vec)		tb="$tb coff-arm.lo cofflink.lo " ;;
     armcoff_big_vec)		tb="$tb coff-arm.lo cofflink.lo " ;;
+    armnetbsd_vec)		tb="$tb armnetbsd.lo aout32.lo" ;;
     armpe_little_vec)		tb="$tb pe-arm.lo cofflink.lo " ;;
     armpe_big_vec)		tb="$tb pe-arm.lo cofflink.lo " ;;
     armpei_little_vec)		tb="$tb pei-arm.lo cofflink.lo " ;;
Index: bfd/targets.c
===================================================================
RCS file: /cvs/binutils/binutils/bfd/targets.c,v
retrieving revision 1.5
diff -u -b -r1.5 targets.c
--- bfd/targets.c	1999/08/18 05:58:46	1.5
+++ bfd/targets.c	1999/08/19 21:52:40
@@ -502,6 +502,7 @@
 extern const bfd_target arm_epoc_pe_big_vec;
 extern const bfd_target arm_epoc_pei_little_vec;
 extern const bfd_target arm_epoc_pei_big_vec;
+extern const bfd_target armnetbsd_vec;
 extern const bfd_target b_out_vec_big_host;
 extern const bfd_target b_out_vec_little_host;
 extern const bfd_target bfd_elf64_alpha_vec;
@@ -784,6 +785,7 @@
 	&arm_epoc_pe_big_vec,
 	&arm_epoc_pei_little_vec,
 	&arm_epoc_pei_big_vec,
+	&armnetbsd_vec,
 	&icoff_big_vec,
 	&icoff_little_vec,
 	&ieee_vec,
Index: ld/ChangeLog
===================================================================
RCS file: /cvs/binutils/binutils/ld/ChangeLog,v
retrieving revision 1.69
diff -u -b -r1.69 ChangeLog
--- ld/ChangeLog	1999/08/19 07:33:57	1.69
+++ ld/ChangeLog	1999/08/19 21:52:44
@@ -1,3 +1,10 @@
+1999-08-19  Roland McGrath  <roland@baalperazim.frob.com>
+
+	* configure.tgt (arm-*-netbsd*): New target.
+	* emulparams/armnbsd.sh: New file.
+	* Makefile.am (ALL_EMULATIONS): Add earmnbsd.o.
+	(earmnbsd.c): New rule with deps.
+
 1999-08-19  Andreas Schwab  <schwab@suse.de>
 
 	* configure.host: Use ${CC} instead of gcc for finding compiler
Index: ld/Makefile.am
===================================================================
RCS file: /cvs/binutils/binutils/ld/Makefile.am,v
retrieving revision 1.13
diff -u -b -r1.13 Makefile.am
--- ld/Makefile.am	1999/08/08 17:37:50	1.13
+++ ld/Makefile.am	1999/08/19 21:52:44
@@ -108,6 +108,7 @@
 	earmaoutb.o \
 	earmaoutl.o \
 	earmcoff.o \
+	earmnbsd.o \
 	earmpe.o \
 	ecoff_sparc.o \
 	ed10velf.o \
@@ -305,6 +306,9 @@
 earmcoff.c:	$(srcdir)/emulparams/armcoff.sh \
   $(srcdir)/emultempl/armcoff.em $(srcdir)/scripttempl/armcoff.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} armcoff "$(tdir_armcoff)"
+earmnbsd.c:	$(srcdir)/emulparams/armnbsd.sh \
+  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} armnbsd "$(tdir_armnbsd)"
 earmpe.c: $(srcdir)/emulparams/armpe.sh \
   $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} armpe "$(tdir_armpe)"
Index: ld/Makefile.in
===================================================================
RCS file: /cvs/binutils/binutils/ld/Makefile.in,v
retrieving revision 1.14
diff -u -b -r1.14 Makefile.in
--- ld/Makefile.in	1999/08/09 20:22:04	1.14
+++ ld/Makefile.in	1999/08/19 21:52:44
@@ -1006,6 +1006,9 @@
 earmcoff.c:	$(srcdir)/emulparams/armcoff.sh \
   $(srcdir)/emultempl/armcoff.em $(srcdir)/scripttempl/armcoff.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} armcoff "$(tdir_armcoff)"
+earmnbsd.c:	$(srcdir)/emulparams/armnbsd.sh \
+  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} armnbsd "$(tdir_armnbsd)"
 earmpe.c: $(srcdir)/emulparams/armpe.sh \
   $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} armpe "$(tdir_armpe)"
Index: ld/configure.tgt
===================================================================
RCS file: /cvs/binutils/binutils/ld/configure.tgt,v
retrieving revision 1.14
diff -u -b -r1.14 configure.tgt
--- ld/configure.tgt	1999/08/05 16:03:55	1.14
+++ ld/configure.tgt	1999/08/19 21:52:44
@@ -133,6 +133,7 @@
 arm*-*-linux-gnu*)	targ_emul=armelf_linux; targ_extra_emuls="armelf_linux26 armelf" ;;
 arm*-*-uclinux*)	targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
 thumb-*-linux-gnu* | thumb-*-uclinux*)	targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+arm-*-netbsd*)		targ_emul=armnbsd ;;
 strongarm-*-coff)	targ_emul=armcoff ;;
 strongarm-*-elf)	targ_emul=armelf ;;
 thumb-*-coff)		targ_emul=armcoff ;;

--- /dev/null	Tue May  5 16:32:27 1998
+++ bfd/armnetbsd.c	Thu Aug 19 16:10:47 1999
@@ -0,0 +1,49 @@
+/* BFD back-end for NetBSD/ARM a.out-ish binaries.
+   Copyright (C) 1990, 1991, 1992 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	BYTES_IN_WORD	4
+#undef TARGET_IS_BIG_ENDIAN_P
+
+#define	TARGET_PAGE_SIZE	4096
+#define	SEGMENT_SIZE	TARGET_PAGE_SIZE
+
+#define	DEFAULT_ARCH	bfd_arch_arm
+#define	DEFAULT_MID 	M_ARM6_NETBSD
+/*#define MACHTYPE_OK(mtype) ((mtype) == M_ARM6_NETBSD)*/
+
+#define MY(OP) CAT(armnetbsd_,OP)
+/* This needs to start with a.out so GDB knows it is an a.out variant.  */
+#define TARGETNAME "a.out-arm-netbsd"
+
+#if 0
+#define NAME(x,y) CAT3(aoutarm,_32_,y)
+
+#define aoutarm_32_get_section_contents aout_32_get_section_contents
+
+#define MY_bfd_reloc_type_lookup aoutarm_bfd_reloc_type_lookup
+
+#include "bfd.h"		/* To ensure following declaration is OK */
+
+CONST struct reloc_howto_struct *
+MY_bfd_reloc_type_lookup
+  PARAMS((bfd *abfd AND
+	  bfd_reloc_code_real_type code));
+#endif
+
+#include "netbsd.h"

--- /dev/null	Tue May  5 16:32:27 1998
+++ ld/emulparams/armnbsd.sh	Thu Aug 19 16:45:51 1999
@@ -0,0 +1,7 @@
+SCRIPT_NAME=aout
+TEXT_START_ADDR=0x1020
+OUTPUT_FORMAT="a.out-arm-netbsd"
+TARGET_PAGE_SIZE=0x1000
+ARCH=arm
+EXECUTABLE_SYMBOLS='__DYNAMIC = 0;'
+NONPAGED_TEXT_START_ADDR=0x1000


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