data->strings = bfd_alloc (abfd, data->symbol_string_length);
#endif
if (!data->symbols || !data->strings)
- {
- bfd_set_error (bfd_error_no_memory);
- return false;
- }
+ return false;
dest_defined = data->symbols + abfd->symcount - 1;
oasys_module_table_type record;
if (!ar || !module)
- {
- bfd_set_error (bfd_error_no_memory);
- return NULL;
- }
+ return NULL;
abfd->tdata.oasys_ar_data = ar;
ar->module = module;
module[i].name = bfd_alloc (abfd, 33);
if (!module[i].name)
- {
- bfd_set_error (bfd_error_no_memory);
- return NULL;
- }
+ return NULL;
memcpy (module[i].name, record_ext.mod_name, 33);
filepos +=
module[i].name = bfd_alloc (abfd, record.module_name_size + 1);
if (!module[i].name)
- {
- bfd_set_error (bfd_error_no_memory);
- return NULL;
- }
+ return NULL;
if (bfd_read ((PTR) module[i].name, 1, record.module_name_size,
abfd)
!= record.module_name_size)
}
buffer = bfd_alloc (abfd, 3);
if (!buffer)
- {
- bfd_set_error (bfd_error_no_memory);
- goto fail;
- }
+ goto fail;
section_number = record.section.relb & RELOCATION_SECT_BITS;
sprintf (buffer, "%u", section_number);
s = bfd_make_section (abfd, buffer);
{
per->data = (bfd_byte *) bfd_zalloc (abfd, section->_raw_size);
if (!per->data)
- {
- bfd_set_error (bfd_error_no_memory);
- return false;
- }
+ return false;
per->reloc_tail_ptr = (oasys_reloc_type **) & (section->relocation);
per->had_vma = false;
per->initialized = true;
bfd_alloc (abfd,
sizeof (oasys_reloc_type));
if (!r)
- {
- bfd_set_error (bfd_error_no_memory);
- return false;
- }
+ return false;
*(per->reloc_tail_ptr) = r;
per->reloc_tail_ptr = &r->next;
r->next = (oasys_reloc_type *) NULL;
bfd_alloc (abfd,
sizeof (oasys_reloc_type));
if (!r)
- {
- bfd_set_error (bfd_error_no_memory);
- return false;
- }
+ return false;
*(per->reloc_tail_ptr) = r;
per->reloc_tail_ptr = &r->next;
r->next = (oasys_reloc_type *) NULL;
newsect->used_by_bfd = (PTR)
bfd_alloc (abfd, sizeof (oasys_per_section_type));
if (!newsect->used_by_bfd)
- {
- bfd_set_error (bfd_error_no_memory);
- return false;
- }
+ return false;
oasys_per_section (newsect)->data = (bfd_byte *) NULL;
oasys_per_section (newsect)->section = newsect;
oasys_per_section (newsect)->offset = 0;
{
if (!isdigit (s->name[0]))
{
+ (*_bfd_error_handler)
+ ("%s: can not represent section `%s' in oasys",
+ bfd_get_filename (abfd), s->name);
bfd_set_error (bfd_error_nonrepresentable_section);
return false;
}
oasys_per_section (section)->data =
(bfd_byte *) (bfd_alloc (abfd, section->_cooked_size));
if (!oasys_per_section (section)->data)
- {
- bfd_set_error (bfd_error_no_memory);
- return false;
- }
+ return false;
}
(void) memcpy ((PTR) (oasys_per_section (section)->data + offset),
location,
oasys_symbol_type *new =
(oasys_symbol_type *) bfd_zalloc (abfd, sizeof (oasys_symbol_type));
if (!new)
- {
- bfd_set_error (bfd_error_no_memory);
- return NULL;
- }
+ return NULL;
new->symbol.the_bfd = abfd;
return &new->symbol;
}