Author: sewardj
Date: 2008-02-26 00:37:24 +0000 (Tue, 26 Feb 2008)
New Revision: 7468

Log:
Accept .eh_frame mapped in a rw- area, if it isn't mapped in an r-x area.


Modified:
   branches/DATASYMS/coregrind/m_debuginfo/readelf.c


Modified: branches/DATASYMS/coregrind/m_debuginfo/readelf.c
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/readelf.c   2008-02-25 20:41:07 UTC 
(rev 7467)
+++ branches/DATASYMS/coregrind/m_debuginfo/readelf.c   2008-02-26 00:37:24 UTC 
(rev 7468)
@@ -1246,9 +1246,11 @@
    TRACE_SYMTAB("\n");
    TRACE_SYMTAB("------ Examining the section headers "
                 "and program headers ------\n");
-   TRACE_SYMTAB("rx: foffsets %ld .. %ld\n",
+   TRACE_SYMTAB("rx: at %p are mapped foffsets %ld .. %ld\n",
+               di->rx_map_avma,
                di->rx_map_foff, di->rx_map_foff + di->rx_map_size - 1 );
-   TRACE_SYMTAB("rw: foffsets %ld .. %ld\n",
+   TRACE_SYMTAB("rw: at %p are mapped foffsets %ld .. %ld\n",
+               di->rw_map_avma,
                di->rw_map_foff, di->rw_map_foff + di->rw_map_size - 1 );
 
    for (i = 0; i < shdr_nent; i++) {
@@ -1494,13 +1496,21 @@
          }
       }
 
-      /* Accept .eh_frame where mapped as rx (code) (?!) */
+      /* Accept .eh_frame where mapped as rx (code).  This seems to be
+         the common case.  However, if that doesn't pan out, try for
+         rw (data) instead. */
       if (0 == VG_(strcmp)(name, ".eh_frame")) {
          if (inrx && size > 0 && !di->ehframe_present) {
             di->ehframe_present = True;
             di->ehframe_avma = di->rx_map_avma + foff - di->rx_map_foff;
             di->ehframe_size = size;
             TRACE_SYMTAB("acquiring .eh_frame avma = %p\n", di->ehframe_avma);
+         } else
+         if (inrw && size > 0 && !di->ehframe_present) {
+            di->ehframe_present = True;
+            di->ehframe_avma = di->rw_map_avma + foff - di->rw_map_foff;
+            di->ehframe_size = size;
+            TRACE_SYMTAB("acquiring .eh_frame avma = %p\n", di->ehframe_avma);
          } else {
             BAD(".eh_frame");
          }


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Valgrind-developers mailing list
Valgrind-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-developers

Reply via email to