[PATCH] NetBSD/vax a.out 1k vs 4k
Jason R Thorpe
thorpej@wasabisystems.com
Sat Jun 8 16:21:00 GMT 2002
Quite some time ago, NetBSD/vax a.out switched from a 1k VM page size
to a 4k VM page size (much like was done with NetBSD/m68k and 4k vs 8k).
This patch corrects the vaxnetbsd a.out vector, and adds a new
vax1knetbsd a.out vector to handle the old binaries.
Committed to trunk.
* Makefile.am (BFD32_BACKENDS): Add vax1knetbsd.lo.
(BFD32_BACKENDS_CFILES): Add vax1knetbsd.c.
Regenerate dependency lists.
* Makefile.in: Regenerate.
* config.bfd (vax-*-netbsdelf*, vax-*-netbsdaout*): Add
vax1knetbsd_vec to targ_selvecs.
* configure.in: Add vax1knetbsd_vec.
* configure: Regenerate.
* targets.c (_bfd_target_vector): Add vax1knetbsd_vec.
* vax1knetbsd.c: New file.
* vaxnetbsd.c: Update copyright years.
(TARGET_PAGE_SIZE): Set to 0x1000.
(DEFAULT_MID): Set to M_VAX4K_NETBSD.
--
-- Jason R. Thorpe <thorpej@wasabisystems.com>
-------------- next part --------------
Index: Makefile.am
===================================================================
RCS file: /cvs/src/src/bfd/Makefile.am,v
retrieving revision 1.88
diff -u -r1.88 Makefile.am
--- Makefile.am 5 Jun 2002 01:50:41 -0000 1.88
+++ Makefile.am 8 Jun 2002 23:11:18 -0000
@@ -293,6 +293,7 @@
sparcnetbsd.lo \
sunos.lo \
vaxnetbsd.lo \
+ vax1knetbsd.lo \
versados.lo \
vms.lo \
vms-gsd.lo \
@@ -445,6 +446,7 @@
sparcnetbsd.c \
sunos.c \
vaxnetbsd.c \
+ vax1knetbsd.c \
versados.c \
vms.c \
vms-gsd.c \
@@ -868,7 +870,8 @@
$(INCDIR)/aout/stab.def $(INCDIR)/safe-ctype.h
stab-syms.lo: stab-syms.c libaout.h $(INCDIR)/bfdlink.h \
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab.def
-merge.lo: merge.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
+merge.lo: merge.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
+ $(INCDIR)/libiberty.h
dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h
@@ -1251,7 +1254,7 @@
$(INCDIR)/elf/external.h
elf-strtab.lo: elf-strtab.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h
+ $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h
elf-eh-frame.lo: elf-eh-frame.c $(INCDIR)/filenames.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h
@@ -1419,6 +1422,9 @@
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
aout-target.h
vaxnetbsd.lo: vaxnetbsd.c netbsd.h $(INCDIR)/filenames.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
+vax1knetbsd.lo: vax1knetbsd.c netbsd.h $(INCDIR)/filenames.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
versados.lo: versados.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h
Index: config.bfd
===================================================================
RCS file: /cvs/src/src/bfd/config.bfd,v
retrieving revision 1.99
diff -u -r1.99 config.bfd
--- config.bfd 5 Jun 2002 19:54:25 -0000 1.99
+++ config.bfd 8 Jun 2002 23:11:22 -0000
@@ -1100,12 +1100,12 @@
vax-*-netbsdelf*)
targ_defvec=bfd_elf32_vax_vec
- targ_selvecs=vaxnetbsd_vec
+ targ_selvecs="vaxnetbsd_vec vax1knetbsd_vec"
;;
vax-*-netbsdaout* | vax-*-netbsd*)
targ_defvec=vaxnetbsd_vec
- targ_selvecs=bfd_elf32_vax_vec
+ targ_selvecs="bfd_elf32_vax_vec vax1knetbsd_vec"
targ_underscore=yes
;;
Index: configure.in
===================================================================
RCS file: /cvs/src/src/bfd/configure.in,v
retrieving revision 1.100
diff -u -r1.100 configure.in
--- configure.in 5 Jun 2002 01:50:42 -0000 1.100
+++ configure.in 8 Jun 2002 23:11:28 -0000
@@ -740,6 +740,7 @@
tic54x_coff2_vec) tb="$tb coff-tic54x.lo" ;;
tic80coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;;
vaxnetbsd_vec) tb="$tb vaxnetbsd.lo aout32.lo" ;;
+ vax1knetbsd_vec) tb="$tb vax1knetbsd.lo aout32.lo" ;;
versados_vec) tb="$tb versados.lo" ;;
vms_alpha_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo"; target_size=64 ;;
vms_vax_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" ;;
Index: targets.c
===================================================================
RCS file: /cvs/src/src/bfd/targets.c,v
retrieving revision 1.65
diff -u -r1.65 targets.c
--- targets.c 5 Jun 2002 03:43:11 -0000 1.65
+++ targets.c 8 Jun 2002 23:11:30 -0000
@@ -671,6 +671,7 @@
extern const bfd_target tic54x_coff2_vec;
extern const bfd_target tic80coff_vec;
extern const bfd_target vaxnetbsd_vec;
+extern const bfd_target vax1knetbsd_vec;
extern const bfd_target versados_vec;
extern const bfd_target vms_alpha_vec;
extern const bfd_target vms_vax_vec;
@@ -979,6 +980,7 @@
&tic54x_coff2_vec,
&tic80coff_vec,
&vaxnetbsd_vec,
+ &vax1knetbsd_vec,
&versados_vec,
#ifdef BFD64
&vms_alpha_vec,
Index: vax1knetbsd.c
===================================================================
RCS file: vax1knetbsd.c
diff -N vax1knetbsd.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ vax1knetbsd.c 8 Jun 2002 23:11:30 -0000
@@ -0,0 +1,37 @@
+/* BFD back-end for NetBSD/VAX (1K page size) a.out-ish binaries.
+ Copyright 1998, 2000, 2001, 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 BYTES_IN_WORD 4
+#undef TARGET_IS_BIG_ENDIAN_P
+
+#define TARGET_PAGE_SIZE 1024
+#define SEGMENT_SIZE TARGET_PAGE_SIZE
+
+#define DEFAULT_ARCH bfd_arch_vax
+#define DEFAULT_MID M_VAX_NETBSD
+
+/* Do not "beautify" the CONCAT* macro args. Traditional C will not
+ remove whitespace added here, and thus will fail to concatenate
+ the tokens. */
+#define MY(OP) CONCAT2 (vax1knetbsd_,OP)
+
+/* This needs to start with a.out so GDB knows it is an a.out variant. */
+#define TARGETNAME "a.out-vax1k-netbsd"
+
+#include "netbsd.h"
Index: vaxnetbsd.c
===================================================================
RCS file: /cvs/src/src/bfd/vaxnetbsd.c,v
retrieving revision 1.4
diff -u -r1.4 vaxnetbsd.c
--- vaxnetbsd.c 2 Oct 2001 05:58:41 -0000 1.4
+++ vaxnetbsd.c 8 Jun 2002 23:11:30 -0000
@@ -1,5 +1,5 @@
-/* BFD back-end for NetBSD/VAX a.out-ish binaries.
- Copyright 1998, 2000, 2001 Free Software Foundation, Inc.
+/* BFD back-end for NetBSD/VAX (4K page size) a.out-ish binaries.
+ Copyright 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -20,11 +20,11 @@
#define BYTES_IN_WORD 4
#undef TARGET_IS_BIG_ENDIAN_P
-#define TARGET_PAGE_SIZE 1024
+#define TARGET_PAGE_SIZE 0x1000
#define SEGMENT_SIZE TARGET_PAGE_SIZE
#define DEFAULT_ARCH bfd_arch_vax
-#define DEFAULT_MID M_VAX_NETBSD
+#define DEFAULT_MID M_VAX4K_NETBSD
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
More information about the Binutils
mailing list