summaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2012-08-10 02:14:49 +0000
committerAlan Modra <amodra@bigpond.net.au>2012-08-10 02:14:49 +0000
commitdea469900c5fd181901770af496169ec11b72fe1 (patch)
tree28e8a6ac0b219b8967533b34670d3899711e57ed /bfd/elf.c
parent1f92589160c4d8de26253722bb4b668cdfdd3b2b (diff)
downloadbinutils-redhat-dea469900c5fd181901770af496169ec11b72fe1.tar.gz
PR binutils/14444
* elf.c (IS_VALID_GROUP_SECTION_HEADER) Add minsize param. (setup_group): Adjust uses. (bfd_section_from_shdr): Allow SHT_GROUP sections with just a flag word.
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 0ac4032b69..0208e05ec1 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;