bfd_zalloc (abfd, sizeof (ecoff_data_type)));
if (abfd->tdata.ecoff_obj_data == NULL)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return false;
}
external_hdr_size = backend->debug_swap.external_hdr_size;
if (bfd_get_symcount (abfd) != external_hdr_size)
{
- bfd_error = bad_value;
+ bfd_set_error (bfd_error_bad_value);
return false;
}
|| (bfd_read (raw, external_hdr_size, 1, abfd)
!= external_hdr_size))
{
- bfd_error = system_call_error;
+ bfd_set_error (bfd_error_system_call);
return false;
}
internal_symhdr = &ecoff_data (abfd)->debug_info.symbolic_header;
if (internal_symhdr->magic != backend->debug_swap.sym_magic)
{
- bfd_error = bad_value;
+ bfd_set_error (bfd_error_bad_value);
return false;
}
raw = (PTR) bfd_alloc (abfd, raw_size);
if (raw == NULL)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return false;
}
if (bfd_seek (abfd,
SEEK_SET) != 0
|| bfd_read (raw, raw_size, 1, abfd) != raw_size)
{
- bfd_error = system_call_error;
+ bfd_set_error (bfd_error_system_call);
bfd_release (abfd, raw);
return false;
}
sizeof (struct fdr)));
if (ecoff_data (abfd)->debug_info.fdr == NULL)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return false;
}
external_fdr_size = backend->debug_swap.external_fdr_size;
new = (ecoff_symbol_type *) bfd_alloc (abfd, sizeof (ecoff_symbol_type));
if (new == (ecoff_symbol_type *) NULL)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return (asymbol *) NULL;
}
memset (new, 0, sizeof *new);
copy = (char *) bfd_alloc (abfd, strlen (name) + 1);
if (!copy)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return false;
}
strcpy (copy, name);
(arelent_chain *) bfd_alloc (abfd, sizeof (arelent_chain));
if (!reloc_chain)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return false;
}
reloc_chain->relent.sym_ptr_ptr =
internal = (ecoff_symbol_type *) bfd_alloc (abfd, internal_size);
if (internal == NULL)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return false;
}
if (internal_relocs == (arelent *) NULL
|| external_relocs == (char *) NULL)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return false;
}
if (bfd_seek (abfd, section->rel_filepos, SEEK_SET) != 0)
if (bfd_read (external_relocs, 1, external_relocs_size, abfd)
!= external_relocs_size)
{
- bfd_error = system_call_error;
+ bfd_set_error (bfd_error_system_call);
return false;
}
struct internal_aouthdr internal_a;
int i;
- bfd_error = system_call_error;
+ bfd_set_error (bfd_error_system_call);
/* Determine where the sections and relocs will go in the output
file. */
buff = bfd_alloc (abfd, current->reloc_count * external_reloc_size);
if (buff == NULL)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return false;
}
|| ((nextname[ARMAP_OBJECT_ENDIAN_INDEX] == ARMAP_BIG_ENDIAN)
^ (abfd->xvec->byteorder_big_p != false)))
{
- bfd_error = wrong_format;
+ bfd_set_error (bfd_error_wrong_format);
return false;
}
raw_armap = (char *) bfd_alloc (abfd, parsed_size);
if (raw_armap == (char *) NULL)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return false;
}
if (bfd_read ((PTR) raw_armap, 1, parsed_size, abfd) != parsed_size)
{
- bfd_error = malformed_archive;
+ bfd_set_error (bfd_error_malformed_archive);
bfd_release (abfd, (PTR) raw_armap);
return false;
}
ardata->symdef_count * sizeof (struct symdef)));
if (!symdef_ptr)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return false;
}
hashtable = (bfd_byte *) bfd_zalloc (abfd, symdefsize);
if (!hashtable)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return false;
}
if (bfd_read ((PTR) armag, 1, SARMAG, abfd) != SARMAG
|| strncmp (armag, ARMAG, SARMAG) != 0)
{
- bfd_error = wrong_format;
+ bfd_set_error (bfd_error_wrong_format);
return (bfd_target *) NULL;
}
if (bfd_ardata (abfd) == (struct artdata *) NULL)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return (bfd_target *) NULL;
}
bfd_hash_allocate (table, sizeof (struct ecoff_link_hash_entry)));
if (ret == (struct ecoff_link_hash_entry *) NULL)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return NULL;
}
malloc (sizeof (struct ecoff_link_hash_table)));
if (!ret)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return NULL;
}
if (! _bfd_link_hash_table_init (&ret->root, abfd,
case bfd_archive:
return ecoff_link_add_archive_symbols (abfd, info);
default:
- bfd_error = wrong_format;
+ bfd_set_error (bfd_error_wrong_format);
return false;
}
}
if (! bfd_has_map (abfd))
{
- bfd_error = no_symbols;
+ bfd_set_error (bfd_error_no_symbols);
return false;
}
ext_count * sizeof (struct bfd_link_hash_entry *)));
if (!sym_hash)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return false;
}
ecoff_data (abfd)->sym_hashes = sym_hash;