From: Alan Modra Date: Sat, 28 Sep 2002 03:26:50 +0000 (+0000) Subject: * elf.c (map_sections_to_segments): Correct test for start of X-Git-Tag: binutils-2_13_1~75 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8e2bc09c6d43e2682d1f768920431b2f953e8ad1;p=thirdparty%2Fbinutils-gdb.git * elf.c (map_sections_to_segments): Correct test for start of writable section in the same page as end of read-only section. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 128a9672590..60ebb5c313a 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-26 Alan Modra * elf64-ppc.c (ppc_build_one_stub): Don't build glink stubs here. diff --git a/bfd/elf.c b/bfd/elf.c index 284b982853f..a7bafb65876 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