aboutsummaryrefslogtreecommitdiff
path: root/bfd/srec.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-11-29 22:05:37 +0000
committerIan Lance Taylor <ian@airs.com>1995-11-29 22:05:37 +0000
commita9713b91a74c2cc05db65ec58573f388d2c41cc0 (patch)
treec786fa623034d37112d9290b9380d06ff0c36a5c /bfd/srec.c
parent8f2bdc203241c910f5ddd969a5ebb5f7199f7edd (diff)
downloadgdb-a9713b91a74c2cc05db65ec58573f388d2c41cc0.zip
gdb-a9713b91a74c2cc05db65ec58573f388d2c41cc0.tar.gz
gdb-a9713b91a74c2cc05db65ec58573f388d2c41cc0.tar.bz2
* opncls.c (bfd_alloc_by_size_t): Set bfd_error_no_memory if
obstack_alloc fails. (bfd_alloc_finish): Set bfd_error_no_memory if obstack_finish fails. * libbfd.c (bfd_zmalloc): Set bfd_error_no_memory if malloc fails. * Many files: don't set bfd_error_no_memory if one of the above routines fails.
Diffstat (limited to 'bfd/srec.c')
-rw-r--r--bfd/srec.c38
1 files changed, 12 insertions, 26 deletions
diff --git a/bfd/srec.c b/bfd/srec.c
index 5ee5f17..4b8fa4b 100644
--- a/bfd/srec.c
+++ b/bfd/srec.c
@@ -208,10 +208,7 @@ srec_mkobject (abfd)
{
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;
@@ -271,8 +268,9 @@ srec_bad_byte (abfd, lineno, c, error)
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);
}
}
@@ -289,10 +287,7 @@ srec_new_symbol (abfd, name, val)
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;
@@ -765,10 +760,7 @@ srec_get_section_contents (abfd, section, location, offset, count)
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;
@@ -796,10 +788,7 @@ srec_set_section_contents (abfd, section, location, offset, bytes_to_do)
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)
@@ -807,10 +796,7 @@ srec_set_section_contents (abfd, section, location, offset, bytes_to_do)
{
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)
@@ -1148,10 +1134,7 @@ srec_get_symtab (abfd, alocation)
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;
@@ -1224,6 +1207,9 @@ srec_print_symbol (ignore_abfd, afile, symbol, how)
((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 \