summaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2007-09-18 08:17:06 +0000
committerAlan Modra <amodra@bigpond.net.au>2007-09-18 08:17:06 +0000
commit70c6480ad7d5ee36a74c14134b99bd570434eed1 (patch)
tree48582efdbc751326d912fa93ff89f36261650790 /bfd/elf.c
parenta6e31c1803dac7e714bdd594c7b156b474312353 (diff)
downloadgdb-70c6480ad7d5ee36a74c14134b99bd570434eed1.tar.gz
* elf.c (bfd_section_from_shdr): Check bfd_alloc return.
(elfcore_write_note): Check realloc return. * elflink.c (_bfd_elf_link_find_version_dependencies): Check bfd_zalloc return. (_bfd_elf_link_assign_sym_version): Check bfd_malloc return. (elf_link_add_object_symbols): Likewise. (struct hash_codes_info): New. (elf_collect_hash_codes): Return bfd_malloc error. (struct collect_gnu_hash_codes): Add "error". (elf_collect_gnu_hash_codes): Return bfd_malloc error. (bfd_elf_size_dynamic_sections): Check return status of _bfd_elf_link_find_version_dependencies. (bfd_elf_size_dynsym_hash_dynstr): Adjust for elf_collect_hash_codes and elf_collect_gnu_hash_codes changes. (elf_sym_name_compare): Formatting. (elf_fixup_link_order): Use bfd_malloc, not xmalloc.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 700d5730964..379216e682b 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1784,6 +1784,8 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
BFD_ASSERT (elf_section_data (target_sect)->rel_hdr2 == NULL);
amt = sizeof (*hdr2);
hdr2 = bfd_alloc (abfd, amt);
+ if (hdr2 == NULL)
+ return FALSE;
elf_section_data (target_sect)->rel_hdr2 = hdr2;
}
*hdr2 = *hdr;
@@ -8105,6 +8107,8 @@ elfcore_write_note (bfd *abfd,
newspace = 12 + ((namesz + 3) & -4) + ((size + 3) & -4);
buf = realloc (buf, *bufsiz + newspace);
+ if (buf == NULL)
+ return buf;
dest = buf + *bufsiz;
*bufsiz += newspace;
xnp = (Elf_External_Note *) dest;