aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c14
1 files changed, 9 insertions, 5 deletions
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;