aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 0ac4032..0208e05 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -545,9 +545,9 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect)
shnum = elf_numsections (abfd);
num_group = 0;
-#define IS_VALID_GROUP_SECTION_HEADER(shdr) \
+#define IS_VALID_GROUP_SECTION_HEADER(shdr, minsize) \
( (shdr)->sh_type == SHT_GROUP \
- && (shdr)->sh_size >= (2 * GRP_ENTRY_SIZE) \
+ && (shdr)->sh_size >= minsize \
&& (shdr)->sh_entsize == GRP_ENTRY_SIZE \
&& ((shdr)->sh_size % GRP_ENTRY_SIZE) == 0)
@@ -555,7 +555,7 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect)
{
Elf_Internal_Shdr *shdr = elf_elfsections (abfd)[i];
- if (IS_VALID_GROUP_SECTION_HEADER (shdr))
+ if (IS_VALID_GROUP_SECTION_HEADER (shdr, 2 * GRP_ENTRY_SIZE))
num_group += 1;
}
@@ -581,7 +581,7 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect)
{
Elf_Internal_Shdr *shdr = elf_elfsections (abfd)[i];
- if (IS_VALID_GROUP_SECTION_HEADER (shdr))
+ if (IS_VALID_GROUP_SECTION_HEADER (shdr, 2 * GRP_ENTRY_SIZE))
{
unsigned char *src;
Elf_Internal_Group *dest;
@@ -1929,7 +1929,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
return TRUE;
case SHT_GROUP:
- if (! IS_VALID_GROUP_SECTION_HEADER (hdr))
+ if (! IS_VALID_GROUP_SECTION_HEADER (hdr, GRP_ENTRY_SIZE))
return FALSE;
if (!_bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex))
return FALSE;