gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 15 Feb 2010 17:37:35 +0000 (17:37 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 15 Feb 2010 17:37:35 +0000 (17:37 +0000)
* solib-svr4.c (LM_ADDR_CHECK): New variable minpagesize.  Optionally
initialize it from ELF BFD.  Extend the prelink condition by it.

gdb/ChangeLog
gdb/solib-svr4.c

index ca892e99385780551abf8a981671459b6ecd12c0..34feb8f244f3e9c4496fd583088afee4fbf27d57 100644 (file)
@@ -1,3 +1,8 @@
+2010-02-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * solib-svr4.c (LM_ADDR_CHECK): New variable minpagesize.  Optionally
+       initialize it from ELF BFD.  Extend the prelink condition by it.
+
 2010-02-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * defs.h (parse_pid_to_attach): New.
index ae3f49ac85bf6ebcb681e5ee74e13756d0533d0b..f8e8e84631823ce9826557c8aea39f5f59557e4f 100644 (file)
@@ -194,6 +194,7 @@ LM_ADDR_CHECK (struct so_list *so, bfd *abfd)
       if (dynaddr + l_addr != l_dynaddr)
        {
          CORE_ADDR align = 0x1000;
+         CORE_ADDR minpagesize = align;
 
          if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
            {
@@ -206,6 +207,8 @@ LM_ADDR_CHECK (struct so_list *so, bfd *abfd)
              for (i = 0; i < ehdr->e_phnum; i++)
                if (phdr[i].p_type == PT_LOAD && phdr[i].p_align > align)
                  align = phdr[i].p_align;
+
+             minpagesize = get_elf_backend_data (abfd)->minpagesize;
            }
 
          /* Turn it into a mask.  */
@@ -230,9 +233,12 @@ LM_ADDR_CHECK (struct so_list *so, bfd *abfd)
             mapping of the library may not actually happen on a 64k boundary!
 
             (In the usual case where (l_addr & align) == 0, this check is
-            equivalent to the possibly expected check above.)  */
+            equivalent to the possibly expected check above.)
+
+            Even on PPC it must be zero-aligned at least for MINPAGESIZE.  */
 
-         if ((l_addr & align) == ((l_dynaddr - dynaddr) & align))
+         if ((l_addr & (minpagesize - 1)) == 0
+             && (l_addr & align) == ((l_dynaddr - dynaddr) & align))
            {
              l_addr = l_dynaddr - dynaddr;
 
This page took 0.032516 seconds and 4 git commands to generate.