aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-08-10 02:14:50 +0000
committerAlan Modra <amodra@gmail.com>2012-08-10 02:14:50 +0000
commit44534af395e517016f70c2b0baee26f810391843 (patch)
tree40c081180c929bfd5aad195b174556a5a8820da1 /bfd/elf.c
parent18a45ee20dd462d596a2f10e0fba2f6ed9eb3b47 (diff)
downloadgdb-44534af395e517016f70c2b0baee26f810391843.zip
gdb-44534af395e517016f70c2b0baee26f810391843.tar.gz
gdb-44534af395e517016f70c2b0baee26f810391843.tar.bz2
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 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;