Browse Source

PR24041, Invalid Memory Address Dereference in elf_link_add_object_symbols

PR 24041
	* elflink.c (elf_link_add_object_symbols): Don't segfault on
	crafted ET_DYN with no program headers.
binutils-2_32-branch
Alan Modra 7 years ago
parent
commit
54025d5812
  1. 6
      bfd/ChangeLog
  2. 2
      bfd/elflink.c

6
bfd/ChangeLog

@ -1,3 +1,9 @@
2018-12-31 Alan Modra <amodra@gmail.com>
PR 24041
* elflink.c (elf_link_add_object_symbols): Don't segfault on
crafted ET_DYN with no program headers.
2018-12-31 Alan Modra <amodra@gmail.com>
* elf64-ppc.c (ppc64_elf_relocate_section <tls_ldgd_opt>): When

2
bfd/elflink.c

@ -4186,7 +4186,7 @@ error_free_dyn:
all sections contained fully therein. This makes relro
shared library sections appear as they will at run-time. */
phdr = elf_tdata (abfd)->phdr + elf_elfheader (abfd)->e_phnum;
while (--phdr >= elf_tdata (abfd)->phdr)
while (phdr-- > elf_tdata (abfd)->phdr)
if (phdr->p_type == PT_GNU_RELRO)
{
for (s = abfd->sections; s != NULL; s = s->next)

Loading…
Cancel
Save