From b89fe0ee4b061b9150fd2ae60800a589ffd163f3 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 28 Sep 2002 03:25:56 +0000 Subject: [PATCH] * elf.c (map_sections_to_segments): Correct test for start of writable section in the same page as end of read-only section. --- bfd/ChangeLog | 5 +++++ bfd/elf.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index a78f22406b7..ed2e0162613 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2002-09-28 Alan Modra + + * elf.c (map_sections_to_segments): Correct test for start of + writable section in the same page as end of read-only section. + 2002-09-27 Matt Thomas * elf32-vax.c (elf_vax_check_relocs): Remove unused 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 -- 2.30.2