* bfd.c (bfd_get_error, bfd_set_error): New functions.

(bfd_error): Make static.
	(bfd_error_type): Renamed from bfd_ec.  Prepend "bfd_error_" to
	all values.
	* bfd-in2.h: Regenerated.
	* aix386-core.c, aout-adobe.c, aout-encap.c, aout-target.h,
	aoutf1.h, aoutx.h, archive.c, archures.c,
	bfd.c, bout.c, cache.c, coff-alpha.c, coff-mips.c,
	coff-rs6000.c, coffcode.h, coffgen.c, core.c, ctor.c,
	ecoff.c, ecofflink.c, elf.c, elf32-hppa.c, elf32-mips.c,
	elfcode.h, format.c, hash.c, hp300hpux.c, hppabsd-core.c,
	i386lynx.c, ieee.c, libbfd.c, libelf.h, linker.c,
	lynx-core.c, nlm.c, nlm32-alpha.c, nlm32-i386.c,
	nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c,
	ptrace-core.c, reloc16.c, rs6000-core.c, section.c, som.c,
	srec.c, sunos.c, syms.c, targets.c, tekhex.c,
	trad-core.c: Change callers.
This commit is contained in:
David MacKenzie
1994-02-17 18:08:41 +00:00
parent 166557e7b1
commit d1ad85a6e6
15 changed files with 303 additions and 269 deletions

View File

@@ -1,5 +1,5 @@
/* Generic target-file-type support for the BFD library.
Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
Copyright 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -39,7 +39,7 @@ DESCRIPTION
how to interpret the file. The operations performed are:
o Create a BFD by calling the internal routine
<<new_bfd>>, then call <<bfd_find_target>> with the
<<_bfd_new_bfd>>, then call <<bfd_find_target>> with the
target string supplied to <<bfd_openr>> and the new BFD pointer.
o If a null target string was provided to <<bfd_find_target>>,
@@ -56,7 +56,7 @@ DESCRIPTION
one by one, until a match on target name is found. When found,
use it.
o Otherwise return the error <<invalid_target>> to
o Otherwise return the error <<bfd_error_invalid_target>> to
<<bfd_openr>>.
o <<bfd_openr>> attempts to open the file using
@@ -414,7 +414,7 @@ extern bfd_target sco_core_vec;
extern bfd_target trad_core_vec;
extern bfd_target ptrace_core_vec;
bfd_target *target_vector[] = {
bfd_target *bfd_target_vector[] = {
#ifdef SELECT_VECS
@@ -482,7 +482,7 @@ bfd_target *target_vector[] = {
&hp300bsd_vec,
#endif
&hp300hpux_vec,
#if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD)
#if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF)
&som_vec,
#endif
&i386aout_vec,
@@ -563,20 +563,20 @@ bfd_target *target_vector[] = {
NULL /* end of list marker */
};
/* default_vector[0] contains either the address of the default vector,
/* bfd_default_vector[0] contains either the address of the default vector,
if there is one, or zero if there isn't. */
bfd_target *default_vector[] = {
bfd_target *bfd_default_vector[] = {
#ifdef DEFAULT_VECTOR
&DEFAULT_VECTOR,
#endif
NULL
};
/* When there is an ambiguous match, bfd_check_format_ambig puts the names
of the matching targets in an array. This variable is the maximum
number of entries that array could possibly need. */
CONST size_t bfd_default_vector_entries = sizeof(target_vector)/sizeof(*target_vector);
/* When there is an ambiguous match, bfd_check_format_matches puts the
names of the matching targets in an array. This variable is the maximum
number of entries that the array could possibly need. */
CONST size_t _bfd_target_vector_entries = sizeof(bfd_target_vector)/sizeof(*bfd_target_vector);
/*
FUNCTION
@@ -610,17 +610,17 @@ DEFUN(bfd_find_target,(target_name, abfd),
/* This is safe; the vector cannot be null */
if (targname == NULL || !strcmp (targname, "default")) {
abfd->target_defaulted = true;
return abfd->xvec = target_vector[0];
return abfd->xvec = bfd_target_vector[0];
}
abfd->target_defaulted = false;
for (target = &target_vector[0]; *target != NULL; target++) {
for (target = &bfd_target_vector[0]; *target != NULL; target++) {
if (!strcmp (targname, (*target)->name))
return abfd->xvec = *target;
}
bfd_error = invalid_target;
bfd_set_error (bfd_error_invalid_target);
return NULL;
}
@@ -651,18 +651,18 @@ DEFUN_VOID(bfd_target_list)
bfd_target **target;
CONST char **name_list, **name_ptr;
for (target = &target_vector[0]; *target != NULL; target++)
for (target = &bfd_target_vector[0]; *target != NULL; target++)
vec_length++;
name_ptr =
name_list = (CONST char **) zalloc ((vec_length + 1) * sizeof (char **));
name_ptr = name_list = (CONST char **)
bfd_zmalloc ((vec_length + 1) * sizeof (char **));
if (name_list == NULL) {
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
return NULL;
}
for (target = &target_vector[0]; *target != NULL; target++)
for (target = &bfd_target_vector[0]; *target != NULL; target++)
*(name_ptr++) = (*target)->name;
return name_list;