aboutsummaryrefslogtreecommitdiff
path: root/bfd/archures.c
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/archures.c
parent481faa25acc8ea42f8d5f5e5e37f137806616226 (diff)
downloadgdb-d94aca1affb15af8374bcb002f6a52fb724c9ccd.zip
gdb-d94aca1affb15af8374bcb002f6a52fb724c9ccd.tar.gz
gdb-d94aca1affb15af8374bcb002f6a52fb724c9ccd.tar.bz2
Safely check in r16 targets for binutils.
Diffstat (limited to 'bfd/archures.c')
-rw-r--r--bfd/archures.c108
1 files changed, 67 insertions, 41 deletions
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;