aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2005-04-18 03:12:51 +0000
committerH.J. Lu <hjl.tools@gmail.com>2005-04-18 03:12:51 +0000
commit20dbb49d3cd4e937732167e8ea281ad938513547 (patch)
treea51e2d569b0757ba9d8c74ad1da4a849846a5870 /bfd
parent69308976e8c42febe2c7a12953b0f2dd2e47d66f (diff)
downloadgdb-20dbb49d3cd4e937732167e8ea281ad938513547.zip
gdb-20dbb49d3cd4e937732167e8ea281ad938513547.tar.gz
gdb-20dbb49d3cd4e937732167e8ea281ad938513547.tar.bz2
2005-04-17 H.J. Lu <hongjiu.lu@intel.com>
PR 855 * elf.c (setup_group): Properly handle zero group count.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf.c14
2 files changed, 14 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 155d34f..a44e8f2 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2005-04-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR 855
+ * elf.c (setup_group): Properly handle zero group count.
+
2005-04-17 Mark Kettenis <kettenis@gnu.org>
* som.c (hppa_som_reloc, som_mkobject, som_is_space)
diff --git a/bfd/elf.c b/bfd/elf.c
index 4c10096..5f68112 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -481,14 +481,18 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect)
}
if (num_group == 0)
- num_group = (unsigned) -1;
- elf_tdata (abfd)->num_group = num_group;
-
- if (num_group > 0)
+ {
+ num_group = (unsigned) -1;
+ elf_tdata (abfd)->num_group = num_group;
+ }
+ else
{
/* We keep a list of elf section headers for group sections,
so we can find them quickly. */
- bfd_size_type amt = num_group * sizeof (Elf_Internal_Shdr *);
+ bfd_size_type amt;
+
+ elf_tdata (abfd)->num_group = num_group;
+ amt = num_group * sizeof (Elf_Internal_Shdr *);
elf_tdata (abfd)->group_sect_ptr = bfd_alloc (abfd, amt);
if (elf_tdata (abfd)->group_sect_ptr == NULL)
return FALSE;