aboutsummaryrefslogtreecommitdiff
path: root/bfd/cpu-rce.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-09-22 22:06:51 +0000
committerIan Lance Taylor <ian@airs.com>1995-09-22 22:06:51 +0000
commit2ffbb79ae4a6a32d70a5a4228259996f76bfc46d (patch)
treeffb62b0d3f954836856ed51fae135c36bb987428 /bfd/cpu-rce.c
parent8f4670da40ac584bc2b35cce734839d273211095 (diff)
downloadgdb-2ffbb79ae4a6a32d70a5a4228259996f76bfc46d.zip
gdb-2ffbb79ae4a6a32d70a5a4228259996f76bfc46d.tar.gz
gdb-2ffbb79ae4a6a32d70a5a4228259996f76bfc46d.tar.bz2
Change arch info to be const, initialized at compile time.
* archures.c: Reindent many functions. Change CONST to const. (bfd_arch_info_type): Make arch_name const. Remove disassemble; nothing set it anyhow. Make next const. (bfd_arch_info_list): Remove. (bfd_archures_list): Rename from archures_init_table. Change from a table of function pointers to a table of bfd_arch_info_type structure addresses. (bfd_scan_arch): Rewrite accordingly. Return a const pointer. (bfd_lookup_arch): Likewise. (bfd_set_arch_info): Rewrite accordingly. Change argument to be a const pointer. (bfd_default_arch_struct): Make const. (bfd_arch_init, bfd_arch_linkin): Remove. (bfd_get_arch_info): Return a const pointer. * init.c (bfd_init): Don't call bfd_arch_init. * bfd.c (struct _bfd): Make arch_info const. * bfd-in2.h: Rebuild. * libbfd.h: Rebuild. * configure.in: Put & before everything in $selarchs. * configure: Rebuild. * cpu-*.c: Change bfd_*_arch from a function which calls bfd_arch_linkin to a const structure. * ieee.c (ieee_object_p): Make arch const.
Diffstat (limited to 'bfd/cpu-rce.c')
-rw-r--r--bfd/cpu-rce.c51
1 files changed, 20 insertions, 31 deletions
diff --git a/bfd/cpu-rce.c b/bfd/cpu-rce.c
index e597e87..ab2e216 100644
--- a/bfd/cpu-rce.c
+++ b/bfd/cpu-rce.c
@@ -25,9 +25,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
int bfd_default_scan_num_mach();
static boolean
-DEFUN(scan_mach,(info, string),
-CONST struct bfd_arch_info *info AND
-CONST char *string)
+scan_mach (info, string)
+ const struct bfd_arch_info *info;
+ const char *string;
{
if (strcmp(string,"rce") == 0) return true;
if (strcmp(string,"RCE") == 0) return true;
@@ -39,10 +39,10 @@ CONST char *string)
/* This routine is provided two arch_infos and returns whether
they'd be compatible */
-static CONST bfd_arch_info_type *
+static const bfd_arch_info_type *
DEFUN(compatible,(a,b),
- CONST bfd_arch_info_type *a AND
- CONST bfd_arch_info_type *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;
@@ -50,29 +50,18 @@ DEFUN(compatible,(a,b),
}
#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_rce,
- 0, /* only 1 machine */
- "RCE", /* arch_name */
- "RCE", /* printable name */
- 1,
- true, /* the default machine */
- bfd_default_compatible,
- scan_mach,
- 0,
- 0,
- },
-};
-
-
-
-void
-DEFUN_VOID(bfd_rce_arch)
+const bfd_arch_info_type bfd_rce_arch =
{
- bfd_arch_linkin(&arch_info_struct[0]);
-}
+ 32, /* 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_rce,
+ 0, /* only 1 machine */
+ "RCE", /* arch_name */
+ "RCE", /* printable name */
+ 1,
+ true, /* the default machine */
+ bfd_default_compatible,
+ scan_mach,
+ 0,
+};