aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2014-01-03 14:16:17 +0000
committerNick Clifton <nickc@redhat.com>2014-01-03 14:16:17 +0000
commitdc9155b24f8d8ea5ecb1af433d12280433b216ce (patch)
tree69b7ed4f9d328510083c8ea11f0cd4198763e703 /bfd
parent8cc4c22675eaac5dabc1f4ffeb396688d1ae3b91 (diff)
downloadgdb-dc9155b24f8d8ea5ecb1af433d12280433b216ce.zip
gdb-dc9155b24f8d8ea5ecb1af433d12280433b216ce.tar.gz
gdb-dc9155b24f8d8ea5ecb1af433d12280433b216ce.tar.bz2
PR binutils/16199
* elf.c (vma_page_aligned_bias): Handle a maxpagesize value of zero.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 3505388..83a9891 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
diff --git a/bfd/elf.c b/bfd/elf.c
index 59b1d4b..ede51e9 100644
--- 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);
}