]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR binutils/16199
authorNick Clifton <nickc@redhat.com>
Fri, 3 Jan 2014 14:16:17 +0000 (14:16 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 3 Jan 2014 14:16:17 +0000 (14:16 +0000)
* elf.c (vma_page_aligned_bias): Handle a maxpagesize value of
zero.

bfd/ChangeLog
bfd/elf.c

index 3505388cc8672b662553fc447a87beb0328b552b..83a98914d896797465b743e729f0850a22f7b119 100644 (file)
@@ -1,3 +1,9 @@
+2014-01-03  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/16199
+       * elf.c (vma_page_aligned_bias): Handle a maxpagesize value of
+       zero.
+
 2014-01-02  Yuanhui Zhang  <asmwarrior@gmail.com>
 
        PR binutils/14289
index 59b1d4b474879eb823ea4c302e4bf4af212b34c3..ede51e92c2f17c7620658d9bea228e5e808ed0de 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1,6 +1,6 @@
 /* ELF executable support for BFD.
 
-   Copyright 1993-2013 Free Software Foundation, Inc.
+   Copyright 1993-2014 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -4313,6 +4313,9 @@ elf_sort_sections (const void *arg1, const void *arg2)
 static file_ptr
 vma_page_aligned_bias (bfd_vma vma, ufile_ptr off, bfd_vma maxpagesize)
 {
+  /* PR binutils/16199: Handle an alignment of zero.  */
+  if (maxpagesize == 0)
+    maxpagesize = 1;
   return ((vma - off) % maxpagesize);
 }