aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2007-09-18 08:17:06 +0000
committerAlan Modra <amodra@gmail.com>2007-09-18 08:17:06 +0000
commit14b1c01e0475f79b97692fbfd9de25c541aeb0b4 (patch)
treeebd07f903e536c2b84b290c8c93802a031a4f52e /bfd/elf.c
parent614f30a283ede08a5d2913a0597581edeb7c0905 (diff)
downloadgdb-14b1c01e0475f79b97692fbfd9de25c541aeb0b4.zip
gdb-14b1c01e0475f79b97692fbfd9de25c541aeb0b4.tar.gz
gdb-14b1c01e0475f79b97692fbfd9de25c541aeb0b4.tar.bz2
* 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 700d573..379216e 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;