From ec35a1c2f303dbbb1ca2df5ac25b0944dcb57a79 Mon Sep 17 00:00:00 2001 From: "J.T. Conklin" Date: Fri, 28 Oct 1994 18:11:15 +0000 Subject: [PATCH] NetBSD/m68k support, based on work by mikeb@snow.datametrics.com: * config.bfd (m68*-*-netbsd*): Use m68k-nbsd as bfd_name. * configure.in (m68knetbsd_vec): Added. * targets.c (bfd_m68knetbsd_vec): Added. * hosts/m68knbsd.h, config/m68k-nbsd.mt, m68knetbsd.c: New files. * Makefile.in (BFD32_BACKENDS, CFILES): Add m68knetbsd.c. miscellaneous cleanup required by all netbsd targets, based on work by Andrew Cagney : * netbsd.h (N_MAGIC, N_SET_MAGIC, N_GETMAGIC, N_GETMAGIC2, N_TXTADDR, N_TXTOFF, N_ALIGN, N_DATADDR, N_DATOFF): Removed. Generic a.out definitions work. * i386nbsd.c, ns32knbsd.c, sparcnbsd.c (__LDPGSZ): Removed. (MY(write_object_contents)): Use NetBSD's magic numbers --- bfd/.Sanitize | 1 + bfd/ChangeLog | 17 +++++++++++++++++ bfd/configure.in | 5 +++-- bfd/hosts/.Sanitize | 1 + bfd/hosts/m68knbsd.h | 14 ++++++++++++++ bfd/m68knetbsd.c | 33 +++++++++++++++++++++++++++++++++ 6 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 bfd/hosts/m68knbsd.h create mode 100644 bfd/m68knetbsd.c diff --git a/bfd/.Sanitize b/bfd/.Sanitize index 7e997b579ea..c6442d20d7e 100644 --- a/bfd/.Sanitize +++ b/bfd/.Sanitize @@ -168,6 +168,7 @@ liboasys.h linker.c lynx-core.c m68klynx.c +m68knetbsd.c m88kmach3.c makefile.dos mipsbsd.c diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 414ef407614..99da14d6b0c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,20 @@ +Fri Oct 28 10:08:41 1994 J.T. Conklin (jtc@rtl.cygnus.com) + + NetBSD/m68k support, based on work by mikeb@snow.datametrics.com: + * config.bfd (m68*-*-netbsd*): Use m68k-nbsd as bfd_name. + * configure.in (m68knetbsd_vec): Added. + * targets.c (bfd_m68knetbsd_vec): Added. + * hosts/m68knbsd.h, config/m68k-nbsd.mt, m68knetbsd.c: New files. + * Makefile.in (BFD32_BACKENDS, CFILES): Add m68knetbsd.c. + + miscellaneous cleanup required by all netbsd targets, based on work + by Andrew Cagney : + * netbsd.h (N_MAGIC, N_SET_MAGIC, N_GETMAGIC, N_GETMAGIC2, N_TXTADDR, + N_TXTOFF, N_ALIGN, N_DATADDR, N_DATOFF): Removed. Generic a.out + definitions work. + * i386nbsd.c, ns32knbsd.c, sparcnbsd.c (__LDPGSZ): Removed. + (MY(write_object_contents)): Use NetBSD's magic numbers + Thu Oct 27 16:59:52 1994 Ian Lance Taylor * libelf.h (struct bfd_elf_section_data): Add field dynindx. diff --git a/bfd/configure.in b/bfd/configure.in index fdcc6b5eb0c..59633429aad 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -49,7 +49,7 @@ all_targets=false for targ in $target $canon_targets do - bfd_target=`$srcdir/config.bfd $targ` + bfd_target=`${config_shell} $srcdir/config.bfd $targ` if [ "x$bfd_target" = "xall" ]; then all_targets=true @@ -189,6 +189,7 @@ do m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o cofflink.o" ;; m68klynx_aout_vec) tb="$tb m68klynx.o lynx-core.o aout32.o stab-syms.o" ;; m68klynx_coff_vec) tb="$tb cf-m68klynx.o coff-m68k.o cofflink.o lynx-core.o stab-syms.o" ;; + m68knetbsd_vec) tb="$tb m68knetbsd.o aout32.o stab-syms.o" ;; m88kbcs_vec) tb="$tb coff-m88k.o" ;; newsos3_vec) tb="$tb newsos3.o aout32.o stab-syms.o" ;; nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;; @@ -200,7 +201,7 @@ do ns32knetbsd_vec) tb="$tb ns32knetbsd.o aout-ns32k.o stab-syms.o" ;; pc532machaout_vec) tb="$tb pc532-mach.o aout-ns32k.o stab-syms.o" ;; rs6000coff_vec) tb="$tb coff-rs6000.o" ;; - shcoff_vec) tb="$tb coff-sh.o reloc16.o" ;; + shcoff_vec) tb="$tb coff-sh.o cofflink.o" ;; som_vec) tb="$tb som.o" ;; sparclynx_aout_vec) tb="$tb sparclynx.o lynx-core.o aout32.o stab-syms.o" ;; sparclynx_coff_vec) tb="$tb cf-sparclynx.o lynx-core.o stab-syms.o" ;; diff --git a/bfd/hosts/.Sanitize b/bfd/hosts/.Sanitize index 357e7e93232..5f5037f82cb 100644 --- a/bfd/hosts/.Sanitize +++ b/bfd/hosts/.Sanitize @@ -60,6 +60,7 @@ irix3.h irix4.h lynx.h m68klynx.h +m68knbsd.h m68kv4.h m88kmach3.h miniframe.h diff --git a/bfd/hosts/m68knbsd.h b/bfd/hosts/m68knbsd.h new file mode 100644 index 00000000000..9c9430d7213 --- /dev/null +++ b/bfd/hosts/m68knbsd.h @@ -0,0 +1,14 @@ +/* m68k hosts running NetBSD */ + +#ifndef hosts_m68knbsd_h +#define hosts_m68knbsd_h + +#include "hosts/nbsd.h" + +#define HOST_MACHINE_ARCH bfd_arch_m68k +#define HOST_BIG_ENDIAN_P + +#define TRAD_UNIX_CORE_FILE_FAILING_SIGNAL(core_bfd) \ + ((core_bfd)->tdata.trad_core_data->u.u_sig) +#define u_comm u_kproc.kp_proc.p_comm +#endif diff --git a/bfd/m68knetbsd.c b/bfd/m68knetbsd.c new file mode 100644 index 00000000000..c6e7fa498d7 --- /dev/null +++ b/bfd/m68knetbsd.c @@ -0,0 +1,33 @@ +/* BFD back-end for NetBSD/m68k 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#define BYTES_IN_WORD 4 +#define TARGET_IS_BIG_ENDIAN_P + +#define PAGE_SIZE 4096 +#define SEGMENT_SIZE 4096 + +#define DEFAULT_ARCH bfd_arch_m68k +#define MACHTYPE_OK(mtype) ((mtype) == M_68020 || (mtype) == M_68K_NETBSD || (mtype) == M_UNKNOWN) + +#define MY(OP) CAT(m68knetbsd_,OP) +/* This needs to start with a.out so GDB knows it is an a.out variant. */ +#define TARGETNAME "a.out-m68k-netbsd" + +#include "netbsd.h" -- 2.30.2