{
tdata_type *tdata = (tdata_type *) bfd_alloc (abfd, sizeof (tdata_type));
if (tdata == NULL)
- {
- bfd_set_error (bfd_error_no_memory);
- return false;
- }
+ return false;
abfd->tdata.srec_data = tdata;
tdata->type = 1;
tdata->head = NULL;
buf[0] = c;
buf[1] = '\0';
}
- fprintf (stderr, "%s:%d: Unexpected character `%s' in S-record file\n",
- bfd_get_filename (abfd), lineno, buf);
+ (*_bfd_error_handler)
+ ("%s:%d: Unexpected character `%s' in S-record file\n",
+ bfd_get_filename (abfd), lineno, buf);
bfd_set_error (bfd_error_bad_value);
}
}
n = (struct srec_symbol *) bfd_alloc (abfd, sizeof (struct srec_symbol));
if (n == NULL)
- {
- bfd_set_error (bfd_error_no_memory);
- return false;
- }
+ return false;
n->name = name;
n->val = val;
{
if (buf != NULL)
free (buf);
- buf = (bfd_byte *) malloc (bytes * 2);
+ buf = (bfd_byte *) bfd_malloc (bytes * 2);
if (buf == NULL)
- {
- bfd_set_error (bfd_error_no_memory);
- goto error_return;
- }
+ goto error_return;
bufsize = bytes * 2;
}
goto error_return;
sec->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
sec->vma = address;
+ sec->lma = address;
sec->_raw_size = bytes;
sec->filepos = pos;
}
{
if (buf != NULL)
free (buf);
- buf = (bfd_byte *) malloc (bytes * 2);
+ buf = (bfd_byte *) bfd_malloc (bytes * 2);
if (buf == NULL)
- {
- bfd_set_error (bfd_error_no_memory);
- goto error_return;
- }
+ goto error_return;
bufsize = bytes * 2;
}
section->used_by_bfd = bfd_alloc (abfd, section->_raw_size);
if (section->used_by_bfd == NULL
&& section->_raw_size != 0)
- {
- bfd_set_error (bfd_error_no_memory);
- return false;
- }
+ return false;
if (! srec_read_section (abfd, section, section->used_by_bfd))
return false;
entry = ((srec_data_list_type *)
bfd_alloc (abfd, sizeof (srec_data_list_type)));
if (entry == NULL)
- {
- bfd_set_error (bfd_error_no_memory);
- return false;
- }
+ return false;
if (bytes_to_do
&& (section->flags & SEC_ALLOC)
{
bfd_byte *data = (bfd_byte *) bfd_alloc (abfd, bytes_to_do);
if (data == NULL)
- {
- bfd_set_error (bfd_error_no_memory);
- return false;
- }
+ return false;
memcpy ((PTR) data, location, (size_t) bytes_to_do);
if ((section->lma + offset + bytes_to_do - 1) <= 0xffff)
csymbols = (asymbol *) bfd_alloc (abfd, symcount * sizeof (asymbol));
if (csymbols == NULL && symcount != 0)
- {
- bfd_set_error (bfd_error_no_memory);
- return false;
- }
+ return false;
abfd->tdata.srec_data->csymbols = csymbols;
for (s = abfd->tdata.srec_data->symbols, c = csymbols;
((long (*) PARAMS ((bfd *, asection *, arelent **, asymbol **))) bfd_0l)
#define srec_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
+#define srec_get_section_contents_in_window \
+ _bfd_generic_get_section_contents_in_window
+
#define srec_set_arch_mach bfd_default_set_arch_mach
#define srec_bfd_get_relocated_section_contents \
0, /* leading underscore */
' ', /* ar_pad_char */
16, /* ar_max_namelen */
- 1, /* minimum alignment */
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
0, /* leading underscore */
' ', /* ar_pad_char */
16, /* ar_max_namelen */
- 1, /* minimum alignment */
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */