+2007-07-24  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * target.c (memory_xfer_partial): Accesses to unmapped overlay
+       sections should always go to the executable file.
+
 2004-07-20  Chris Dearman  <chris@mips.com>
 
        * mips-tdep.c (heuristic_proc_start): Add more MIPS16 function
 
        return xfer_memory (memaddr, readbuf, len, 0, NULL, ops);
     }
 
+  /* Likewise for accesses to unmapped overlay sections.  */
+  if (readbuf != NULL && overlay_debugging)
+    {
+      asection *section = find_pc_overlay (memaddr);
+      if (pc_in_unmapped_range (memaddr, section))
+       return xfer_memory (memaddr, readbuf, len, 0, NULL, ops);
+    }
+
   /* Try GDB's internal data cache.  */
   region = lookup_mem_region (memaddr);
   /* region->hi == 0 means there's no upper bound.  */