]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* elf.c (map_sections_to_segments): Correct test for start of
authorAlan Modra <amodra@gmail.com>
Sat, 28 Sep 2002 03:26:50 +0000 (03:26 +0000)
committerAlan Modra <amodra@gmail.com>
Sat, 28 Sep 2002 03:26:50 +0000 (03:26 +0000)
writable section in the same page as end of read-only section.

bfd/ChangeLog
bfd/elf.c

index 128a967259013e13530111a309e04fa7c73da40a..60ebb5c313afb6c7b06166c81ea74d6a9c9982f8 100644 (file)
@@ -1,3 +1,8 @@
+2002-09-28  Alan Modra  <amodra@bigpond.net.au>
+
+       * 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  <amodra@bigpond.net.au>
 
        * elf64-ppc.c (ppc_build_one_stub): Don't build glink stubs here.
index 284b982853fd76c16f04fce917a9df04ad80c348..a7bafb6587638bb7a7c82360747a2e349fb3d314 100644 (file)
--- 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