summaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2002-09-28 03:25:56 +0000
committerAlan Modra <amodra@bigpond.net.au>2002-09-28 03:25:56 +0000
commit93fd714d83b63c86ad60c6e0c7e808fac77ad0f0 (patch)
treecdfb5a4a5a07906d32bec7fd1b0479eef6ff9eb7 /bfd/elf.c
parent29dc5aff73bb1b189d5a1c01a353502404cfa807 (diff)
downloadgdb-93fd714d83b63c86ad60c6e0c7e808fac77ad0f0.tar.gz
* elf.c (map_sections_to_segments): Correct test for start of
writable section in the same page as end of read-only section.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index b8a300e4a64..c1e2d118071 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -3317,8 +3317,9 @@ map_sections_to_segments (abfd)
}
else if (! writable
&& (hdr->flags & SEC_READONLY) == 0
- && (BFD_ALIGN (last_hdr->lma + last_hdr->_raw_size, maxpagesize)
- == hdr->lma))
+ && (((last_hdr->lma + last_hdr->_raw_size - 1)
+ & ~(maxpagesize - 1))
+ != (hdr->lma & ~(maxpagesize - 1))))
{
/* We don't want to put a writable section in a read only
segment, unless they are on the same page in memory