Blob Blame History Raw
diff -Nrup a/bfd/elf.c b/bfd/elf.c
--- a/bfd/elf.c	2015-05-26 16:15:38.169585374 -0600
+++ b/bfd/elf.c	2015-05-26 16:16:07.571947059 -0600
@@ -3912,6 +3912,11 @@ _bfd_elf_map_sections_to_segments (bfd *
       last_size = 0;
       phdr_index = 0;
       maxpagesize = bed->maxpagesize;
+      /* PR 17512: file: c8455299.
+	 Avoid divide-by-zero errors later on.
+	 FIXME: Should we abort if the maxpagesize is zero ?  */
+      if (maxpagesize == 0)
+	maxpagesize = 1;
       writable = FALSE;
       dynsec = bfd_get_section_by_name (abfd, ".dynamic");
       if (dynsec != NULL