diff options
author | Ian Lance Taylor <ian@airs.com> | 1995-11-29 22:05:37 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1995-11-29 22:05:37 +0000 |
commit | a9713b91a74c2cc05db65ec58573f388d2c41cc0 (patch) | |
tree | c786fa623034d37112d9290b9380d06ff0c36a5c /bfd/elflink.h | |
parent | 8f2bdc203241c910f5ddd969a5ebb5f7199f7edd (diff) | |
download | gdb-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/elflink.h')
-rw-r--r-- | bfd/elflink.h | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h index 37dd443..cdf3afb 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -279,10 +279,7 @@ elf_link_add_object_symbols (abfd, info) sz = bfd_section_size (abfd, s); msg = (char *) bfd_alloc (abfd, sz); if (msg == NULL) - { - bfd_set_error (bfd_error_no_memory); - goto error_return; - } + goto error_return; if (! bfd_get_section_contents (abfd, s, msg, (file_ptr) 0, sz)) goto error_return; @@ -344,10 +341,7 @@ elf_link_add_object_symbols (abfd, info) bfd_alloc (abfd, extsymcount * sizeof (struct elf_link_hash_entry *))); if (sym_hash == NULL) - { - bfd_set_error (bfd_error_no_memory); - goto error_return; - } + goto error_return; elf_sym_hashes (abfd) = sym_hash; if (elf_elfheader (abfd)->e_type != ET_DYN) @@ -1446,10 +1440,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, s->_raw_size = dynsymcount * sizeof (Elf_External_Sym); s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size); if (s->contents == NULL && s->_raw_size != 0) - { - bfd_set_error (bfd_error_no_memory); - return false; - } + return false; /* The first entry in .dynsym is a dummy symbol. */ isym.st_value = 0; @@ -1473,10 +1464,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, s->_raw_size = (2 + bucketcount + dynsymcount) * (ARCH_SIZE / 8); s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size); if (s->contents == NULL) - { - bfd_set_error (bfd_error_no_memory); - return false; - } + return false; memset (s->contents, 0, (size_t) s->_raw_size); put_word (output_bfd, bucketcount, s->contents); @@ -1856,10 +1844,7 @@ elf_bfd_final_link (abfd, info) so we allocate it with bfd_alloc rather than malloc. */ rel_hdr->contents = (PTR) bfd_alloc (abfd, rel_hdr->sh_size); if (rel_hdr->contents == NULL && rel_hdr->sh_size != 0) - { - bfd_set_error (bfd_error_no_memory); - goto error_return; - } + goto error_return; p = ((struct elf_link_hash_entry **) malloc (o->reloc_count @@ -3044,10 +3029,7 @@ elf_reloc_link_order (output_bfd, info, output_section, link_order) size = bfd_get_reloc_size (howto); buf = (bfd_byte *) bfd_zmalloc (size); if (buf == (bfd_byte *) NULL) - { - bfd_set_error (bfd_error_no_memory); - return false; - } + return false; rstat = _bfd_relocate_contents (howto, output_bfd, link_order->u.reloc.p->addend, buf); switch (rstat) |