aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorMichael Tiemann <tiemann@cygnus>1994-11-24 20:30:11 +0000
committerMichael Tiemann <tiemann@cygnus>1994-11-24 20:30:11 +0000
commitd94aca1affb15af8374bcb002f6a52fb724c9ccd (patch)
treec82833f1008f99eb1afc251e5c506ca5418a4520 /bfd
parent481faa25acc8ea42f8d5f5e5e37f137806616226 (diff)
downloadgdb-d94aca1affb15af8374bcb002f6a52fb724c9ccd.zip
gdb-d94aca1affb15af8374bcb002f6a52fb724c9ccd.tar.gz
gdb-d94aca1affb15af8374bcb002f6a52fb724c9ccd.tar.bz2
Safely check in r16 targets for binutils.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/.Sanitize8
-rw-r--r--bfd/aout-r16.c38
-rw-r--r--bfd/archures.c108
-rwxr-xr-xbfd/config.bfd8
-rw-r--r--bfd/configure.in3
-rw-r--r--bfd/cpu-r16.c79
-rw-r--r--bfd/targets.c6
7 files changed, 208 insertions, 42 deletions
diff --git a/bfd/.Sanitize b/bfd/.Sanitize
index c6442d2..3cbe36b 100644
--- a/bfd/.Sanitize
+++ b/bfd/.Sanitize
@@ -23,6 +23,14 @@ else
lose_these_too="${mpw_files} ${lose_these_too}"
fi
+r16_files="cpu-r16.c aout-r16.c"
+
+if ( echo $* | grep keep\-r16 > /dev/null ) ; then
+ keep_these_too="${r16_files} ${keep_these_too}"
+else
+ lose_these_too="${r16_files} ${lose_these_too}"
+fi
+
# All files listed between the "Things-to-keep:" line and the
# "Files-to-sed:" line will be kept. All other files will be removed.
# Directories listed in this section will have their own Sanitize
diff --git a/bfd/aout-r16.c b/bfd/aout-r16.c
new file mode 100644
index 0000000..a89f140
--- /dev/null
+++ b/bfd/aout-r16.c
@@ -0,0 +1,38 @@
+/* BFD back-end for SOP a.out binaries.
+ Copyright 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 TARGET_IS_BIG_ENDIAN_P
+#define PAGE_SIZE 4096
+#define SEGMENT_SIZE 4096
+#define TEXT_START_ADDR 0x0
+/* #define N_HEADER_IN_TEXT(x) 0 */
+#define N_SHARED_LIB(x) 0
+#define ARCH 32
+#define BYTES_IN_WORD 4
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "aout/aout64.h"
+#include "aout/stab_gnu.h"
+#include "aout/ar.h"
+#include "libaout.h"
+#define DEFAULT_ARCH bfd_arch_sop
+#define MY(OP) CAT(sop_aout_,OP)
+#define TARGETNAME "a.out-sop"
+#include "aout-target.h"
diff --git a/bfd/archures.c b/bfd/archures.c
index d58e332..31acf4a 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -1,8 +1,7 @@
/* BFD library support routines for architectures.
- Copyright (C) 1990-1991 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
Hacked by John Gilmore and Steve Chamberlain of Cygnus Support.
-
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
@@ -35,7 +34,7 @@ SECTION
The architecture information is provided by each architecture package.
The set of default architectures is selected by the macro
<<SELECT_ARCHITECTURES>>. This is normally set up in the
- <<config/target.mt>> file of your choice. If the name is not
+ @file{config/@var{target}.mt} file of your choice. If the name is not
defined, then all the architectures supported are included.
When BFD starts up, all the architectures are called with an
@@ -44,7 +43,7 @@ SECTION
generally this would be one for each machine and one for the
default case (an item with a machine field of 0).
- BFD's idea of an architecture is implemented in <<archures.c>>.
+ BFD's idea of an architecture is implemented in @file{archures.c}.
*/
/*
@@ -82,6 +81,9 @@ DESCRIPTION
.#define bfd_mach_i960_mc 4
.#define bfd_mach_i960_xa 5
.#define bfd_mach_i960_ca 6
+. {* start-sanitize-i960xl *}
+.#define bfd_mach_i960_xl 7
+. {* end-sanitize-i960xl *}
.
. bfd_arch_a29k, {* AMD 29000 *}
. bfd_arch_sparc, {* SPARC *}
@@ -98,6 +100,7 @@ DESCRIPTION
. bfd_arch_h8300, {* Hitachi H8/300 *}
.#define bfd_mach_h8300 1
.#define bfd_mach_h8300h 2
+. bfd_arch_powerpc, {* PowerPC *}
. bfd_arch_rs6000, {* IBM RS/6000 *}
. bfd_arch_hppa, {* HP PA RISC *}
. bfd_arch_z8k, {* Zilog Z8000 *}
@@ -106,6 +109,8 @@ DESCRIPTION
. bfd_arch_h8500, {* Hitachi H8/500 *}
. bfd_arch_sh, {* Hitachi SH *}
. bfd_arch_alpha, {* Dec Alpha *}
+. bfd_arch_arm, {* Advanced Risc Machines ARM *}
+. bfd_arch_ns32k, {* National Semiconductors ns32000 *}
. bfd_arch_last
. };
@@ -172,8 +177,8 @@ DESCRIPTION
*/
CONST char *
-DEFUN(bfd_printable_name, (abfd),
- bfd *abfd)
+bfd_printable_name (abfd)
+ bfd *abfd;
{
return abfd->arch_info->printable_name;
}
@@ -195,8 +200,8 @@ DESCRIPTION
*/
bfd_arch_info_type *
-DEFUN(bfd_scan_arch,(string),
- CONST char *string)
+bfd_scan_arch (string)
+ CONST char *string;
{
struct bfd_arch_info *ap;
@@ -231,10 +236,9 @@ DESCRIPTION
*/
CONST bfd_arch_info_type *
-DEFUN(bfd_arch_get_compatible,(abfd, bbfd),
-CONST bfd *abfd AND
-CONST bfd *bbfd)
-
+bfd_arch_get_compatible (abfd, bbfd)
+ CONST bfd *abfd;
+ CONST bfd *bbfd;
{
return abfd->arch_info->compatible(abfd->arch_info,bbfd->arch_info);
}
@@ -274,9 +278,10 @@ DESCRIPTION
Set the architecture info of @var{abfd} to @var{arg}.
*/
-void DEFUN(bfd_set_arch_info,(abfd, arg),
-bfd *abfd AND
-bfd_arch_info_type *arg)
+void
+bfd_set_arch_info (abfd, arg)
+ bfd *abfd;
+ bfd_arch_info_type *arg;
{
abfd->arch_info = arg;
}
@@ -297,10 +302,11 @@ DESCRIPTION
pointer.
*/
-boolean DEFUN(bfd_default_set_arch_mach,(abfd, arch, mach),
- bfd *abfd AND
- enum bfd_architecture arch AND
- unsigned long mach)
+boolean
+bfd_default_set_arch_mach (abfd, arch, mach)
+ bfd *abfd;
+ enum bfd_architecture arch;
+ unsigned long mach;
{
static struct bfd_arch_info *old_ptr = &bfd_default_arch_struct;
boolean found = false;
@@ -322,7 +328,7 @@ boolean DEFUN(bfd_default_set_arch_mach,(abfd, arch, mach),
if (found==false) {
/*looked for it and it wasn't there, so put in the default */
old_ptr = &bfd_default_arch_struct;
- bfd_error = bad_value;
+ bfd_set_error (bfd_error_bad_value);
}
}
else {
@@ -349,7 +355,9 @@ DESCRIPTION
*/
-enum bfd_architecture DEFUN(bfd_get_arch, (abfd), bfd *abfd)
+enum bfd_architecture
+bfd_get_arch (abfd)
+ bfd *abfd;
{
return abfd->arch_info->arch;
}
@@ -367,7 +375,8 @@ DESCRIPTION
*/
unsigned long
-DEFUN(bfd_get_mach, (abfd), bfd *abfd)
+bfd_get_mach (abfd)
+ bfd *abfd;
{
return abfd->arch_info->mach;
}
@@ -385,7 +394,9 @@ DESCRIPTION
*/
-unsigned int DEFUN(bfd_arch_bits_per_byte, (abfd), bfd *abfd)
+unsigned int
+bfd_arch_bits_per_byte (abfd)
+ bfd *abfd;
{
return abfd->arch_info->bits_per_byte;
}
@@ -402,7 +413,9 @@ DESCRIPTION
architecture's addresses.
*/
-unsigned int DEFUN(bfd_arch_bits_per_address, (abfd), bfd *abfd)
+unsigned int
+bfd_arch_bits_per_address (abfd)
+ bfd *abfd;
{
return abfd->arch_info->bits_per_address;
}
@@ -410,6 +423,7 @@ unsigned int DEFUN(bfd_arch_bits_per_address, (abfd), bfd *abfd)
extern void bfd_a29k_arch PARAMS ((void));
extern void bfd_alpha_arch PARAMS ((void));
+extern void bfd_arm_arch PARAMS ((void));
extern void bfd_h8300_arch PARAMS ((void));
extern void bfd_h8500_arch PARAMS ((void));
extern void bfd_hppa_arch PARAMS ((void));
@@ -418,12 +432,17 @@ extern void bfd_i960_arch PARAMS ((void));
extern void bfd_m68k_arch PARAMS ((void));
extern void bfd_m88k_arch PARAMS ((void));
extern void bfd_mips_arch PARAMS ((void));
+extern void bfd_powerpc_arch PARAMS ((void));
extern void bfd_rs6000_arch PARAMS ((void));
extern void bfd_sh_arch PARAMS ((void));
+/* start-sanitize-r16 */
+extern void bfd_r16_arch PARAMS ((void));
+/* end-sanitize-r16 */
extern void bfd_sparc_arch PARAMS ((void));
extern void bfd_vax_arch PARAMS ((void));
extern void bfd_we32k_arch PARAMS ((void));
extern void bfd_z8k_arch PARAMS ((void));
+extern void bfd_ns32k_arch PARAMS ((void));
static void (*archures_init_table[]) PARAMS ((void)) =
{
@@ -432,6 +451,7 @@ static void (*archures_init_table[]) PARAMS ((void)) =
#else
bfd_a29k_arch,
bfd_alpha_arch,
+ bfd_arm_arch,
bfd_h8300_arch,
bfd_h8500_arch,
bfd_hppa_arch,
@@ -440,12 +460,17 @@ static void (*archures_init_table[]) PARAMS ((void)) =
bfd_m68k_arch,
bfd_m88k_arch,
bfd_mips_arch,
+ bfd_powerpc_arch,
bfd_rs6000_arch,
bfd_sh_arch,
+/* start-sanitize-r16 */
+ bfd_r16_arch,
+/* end-sanitize-r16 */
bfd_sparc_arch,
bfd_vax_arch,
bfd_we32k_arch,
bfd_z8k_arch,
+ bfd_ns32k_arch,
#endif
0
};
@@ -466,7 +491,7 @@ DESCRIPTION
*/
void
-DEFUN_VOID(bfd_arch_init)
+bfd_arch_init ()
{
void (**ptable) PARAMS ((void));
for (ptable = archures_init_table;
@@ -489,8 +514,9 @@ DESCRIPTION
Link the architecture info structure @var{ptr} into the list.
*/
-void DEFUN(bfd_arch_linkin,(ptr),
- bfd_arch_info_type *ptr)
+void
+bfd_arch_linkin (ptr)
+ bfd_arch_info_type *ptr;
{
ptr->next = bfd_arch_info_list;
bfd_arch_info_list = ptr;
@@ -511,9 +537,9 @@ DESCRIPTION
*/
CONST bfd_arch_info_type *
-DEFUN(bfd_default_compatible,(a,b),
- CONST bfd_arch_info_type *a AND
- CONST bfd_arch_info_type *b)
+bfd_default_compatible (a,b)
+ CONST bfd_arch_info_type *a;
+ CONST bfd_arch_info_type *b;
{
if(a->arch != b->arch) return NULL;
@@ -540,9 +566,9 @@ DESCRIPTION
*/
boolean
-DEFUN(bfd_default_scan,(info, string),
-CONST struct bfd_arch_info *info AND
-CONST char *string)
+bfd_default_scan (info, string)
+ CONST struct bfd_arch_info *info;
+ CONST char *string;
{
CONST char *ptr_src;
CONST char *ptr_tst;
@@ -661,8 +687,8 @@ DESCRIPTION
*/
bfd_arch_info_type *
-DEFUN(bfd_get_arch_info,(abfd),
-bfd *abfd)
+bfd_get_arch_info (abfd)
+ bfd *abfd;
{
return abfd->arch_info;
}
@@ -686,9 +712,9 @@ DESCRIPTION
*/
bfd_arch_info_type *
-DEFUN(bfd_lookup_arch,(arch, machine),
-enum bfd_architecture arch AND
-long machine)
+bfd_lookup_arch (arch, machine)
+ enum bfd_architecture arch;
+ long machine;
{
bfd_arch_info_type *ap;
bfd_check_init();
@@ -721,9 +747,9 @@ DESCRIPTION
*/
CONST char *
-DEFUN(bfd_printable_arch_mach,(arch, machine),
- enum bfd_architecture arch AND
- unsigned long machine)
+bfd_printable_arch_mach (arch, machine)
+ enum bfd_architecture arch;
+ unsigned long machine;
{
bfd_arch_info_type *ap = bfd_lookup_arch(arch, machine);
if(ap) return ap->printable_name;
diff --git a/bfd/config.bfd b/bfd/config.bfd
index 5153d8e..3f93128 100755
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -25,6 +25,7 @@ strip_underscore=no
case "${canon}" in
alpha-*-netware*) bfd_name=alpha-nlm ;;
alpha-*-*) bfd_name=alphaosf ;;
+ arm-*-riscix*) bfd_name=riscix ;;
a29k-*-ebmon*) bfd_name=a29k-coff strip_underscore=yes ;;
a29k-*-udi*) bfd_name=a29k-coff strip_underscore=yes ;;
a29k-*-aout*) bfd_name=a29k-aout strip_underscore=yes ;;
@@ -33,6 +34,9 @@ case "${canon}" in
h8300*-*-*) bfd_name=h8300-coff strip_underscore=yes ;;
h8500-*-*) bfd_name=h8500-coff strip_underscore=yes ;;
sh-*-*) bfd_name=sh-coff strip_underscore=yes ;;
+# start-sanitize-r16
+ r16-*-aout) bfd_name=r16-aout ;;
+# end-sanitize-r16
hppa*-*-*elf*) bfd_name=hppa-elf ;;
hppa*-*-bsd*) bfd_name=hppabsd ;;
hppa*-*-hpux*) bfd_name=hppahpux ;;
@@ -49,7 +53,7 @@ case "${canon}" in
i[345]86-*-coff) bfd_name=i386-coff ;;
i[345]86-*-aix*) bfd_name=i386-coff ;;
i[345]86-*-elf) bfd_name=i386-elf ;;
- i[345]86-*-netbsd*) bfd_name=i386-netbsd strip_underscore=yes ;;
+ i[345]86-*-netbsd*) bfd_name=i386-nbsd strip_underscore=yes ;;
i[345]86-*-netware*) bfd_name=i386-nlm ;;
i[345]86-*-linux*) bfd_name=i386-linux strip_underscore=yes ;;
i[345]86-*-lynxos*) bfd_name=i386-lynx ;;
@@ -73,6 +77,7 @@ case "${canon}" in
m68*-*-coff*) bfd_name=m68k-coff ;;
m68*-*-hpux*) bfd_name=hp300hpux strip_underscore=yes ;;
m68*-*-lynxos*) bfd_name=m68k-lynx ;;
+ m68*-*-netbsd*) bfd_name=m68k-nbsd strip_underscore=yes ;;
m68*-*-os68k*) bfd_name=m68k-aout strip_underscore=yes ;;
m68*-*-sunos*) bfd_name=m68k-aout strip_underscore=yes ;;
m68*-*-sysv4*) bfd_name=m68k-elf ;;
@@ -111,6 +116,7 @@ case "${canon}" in
powerpc-*-netware*) bfd_name=ppc-nlm ;;
rs6000-*-*) bfd_name=rs6000 ;;
sparc-*-lynxos*) bfd_name=sparc-lynx ;;
+ sparc-*-netbsd*) bfd_name=sparc-nbsd strip_underscore=yes;;
sparc-*-solaris2*) bfd_name=sparc-elf ;;
sparc-*-sysv4*) bfd_name=sparc-elf ;;
sparc64-*-aout*) bfd_name=sparc-aout strip_underscore=yes ;;
diff --git a/bfd/configure.in b/bfd/configure.in
index 41d31cd..04a4223 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -202,6 +202,9 @@ do
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 cofflink.o" ;;
+# start-sanitize-r16
+ r16_aout_vec) tb="$tb aout32.o reloc16.o" ;;
+# end-sanitize-r16
shlcoff_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" ;;
diff --git a/bfd/cpu-r16.c b/bfd/cpu-r16.c
new file mode 100644
index 0000000..276fe3a
--- /dev/null
+++ b/bfd/cpu-r16.c
@@ -0,0 +1,79 @@
+/* BFD library support routines for the Experiment SOP architecture.
+ Copyright (C) 1993 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. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+
+
+int bfd_default_scan_num_mach();
+
+static boolean
+DEFUN(scan_mach,(info, string),
+CONST struct bfd_arch_info *info AND
+CONST char *string)
+{
+ if (strcmp(string,"sop") == 0) return true;
+ if (strcmp(string,"SOP") == 0) return true;
+ return false;
+}
+
+
+#if 0
+/* This routine is provided two arch_infos and returns whether
+ they'd be compatible */
+
+static CONST bfd_arch_info_type *
+DEFUN(compatible,(a,b),
+ CONST bfd_arch_info_type *a AND
+ CONST bfd_arch_info_type *b)
+{
+ if (a->arch != b->arch || a->mach != b->mach)
+ return NULL;
+ return a;
+}
+#endif
+
+static bfd_arch_info_type arch_info_struct[] =
+{
+ {
+ 32, /* 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_r16,
+ 0, /* only 1 machine */
+ "SOP", /* arch_name */
+ "SOP", /* printable name */
+ 1,
+ true, /* the default machine */
+ bfd_default_compatible,
+ scan_mach,
+ 0,
+ 0,
+ },
+};
+
+
+
+void
+DEFUN_VOID(bfd_sop_arch)
+{
+ bfd_arch_linkin(&arch_info_struct[0]);
+}
+
diff --git a/bfd/targets.c b/bfd/targets.c
index 5cf0130..4bfe769 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -486,6 +486,9 @@ extern const bfd_target pc532machaout_vec;
extern const bfd_target riscix_vec;
extern const bfd_target rs6000coff_vec;
extern const bfd_target shcoff_vec;
+/* start-sanitize-r16 */
+extern bfd_target r16_aout_vec;
+/* end-sanitize-r16 */
extern const bfd_target shlcoff_vec;
extern const bfd_target sparclynx_aout_vec;
extern const bfd_target sparclynx_coff_vec;
@@ -637,6 +640,9 @@ const bfd_target * const bfd_target_vector[] = {
&rs6000coff_vec,
&shcoff_vec,
&shlcoff_vec,
+/* start-sanitize-r16 */
+ &r16_aout_vec,
+/* end-sanitize-r16 */
&sparclynx_aout_vec,
&sparclynx_coff_vec,
&sparcnetbsd_vec,