]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
PR23199, Invalid SHT_GROUP entry leads to group confusion
authorAlan Modra <amodra@gmail.com>
Fri, 18 May 2018 07:39:45 +0000 (17:09 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 18 May 2018 22:53:57 +0000 (08:23 +0930)
commite3d435293f0dd45247e8057574389f322f5fe5a2
tree13e50517083a2f7b322b4fc2899d3fc10a33fa01
parent3ae0d978bbf68490a41ed61db4ac295375a183e8
PR23199, Invalid SHT_GROUP entry leads to group confusion

This patch prevents elf_next_in_group list pointer confusion when
SHT_GROUP sections specify other SHT_GROUP sections in their list of
group sections.

PR 23199
* elf.c (setup_group): Formatting.  Check that SHT_GROUP entries
don't point at other SHT_GROUP sections.  Set shdr corresponding
to invalid entry, to NULL rather than section 0.  Identify
SHT_GROUP section index when reporting an error.  Cope with NULL
shdr pointer.

(cherry picked from commit 4bba0fb1c6d391a217c25e44398a7e1c7090155f)
bfd/ChangeLog
bfd/elf.c