+2013-01-02  Iain Sandoe  <developer@sandoe-acoustics.co.uk>
+
+       * darwin-nat.c (darwin_read_dyld_info): Only build if
+       TASK_DYLD_INFO_COUNT is defined.
+       (darwin_xfer_partial): Call darwin_read_dyld_info only if
+       TASK_DYLD_INFO_COUNT is defined.
+
 2013-01-02  Tom Tromey  <tromey@redhat.com>
 
        * symfile.h (struct ecoff_debug_hack): Remove.
 
 
 /* Read LENGTH bytes at offset ADDR of task_dyld_info for TASK, and copy them
    to RDADDR.
-   Return 0 on failure; number of bytes read / writen otherwise.  */
+   Return 0 on failure; number of bytes read / written otherwise.  */
 
+#ifndef TASK_DYLD_INFO_COUNT
+/* This is not available in Darwin 9.  */
 static int
 darwin_read_dyld_info (task_t task, CORE_ADDR addr, char *rdaddr, int length)
 {
   memcpy (rdaddr, (char *)&task_dyld_info + addr, length);
   return length;
 }
+#endif
 
 \f
 /* Return 0 on failure, number of bytes handled otherwise.  TARGET
     case TARGET_OBJECT_MEMORY:
       return darwin_read_write_inferior (inf->private->task, offset,
                                          readbuf, writebuf, len);
+#ifdef TASK_DYLD_INFO_COUNT
     case TARGET_OBJECT_DARWIN_DYLD_INFO:
       if (writebuf != NULL || readbuf == NULL)
         {
           return -1;
         }
       return darwin_read_dyld_info (inf->private->task, offset, readbuf, len);
+#endif
     default:
       return -1;
     }