Don't always build coffgen.o
[deliverable/binutils-gdb.git] / gdb / solib-darwin.c
index a9989ea27dced038d4914c2bcf30d5701049d5f7..e9bbb77d86604bf7eeefe83d2364c6bbf3493e78 100644 (file)
@@ -30,8 +30,6 @@
 #include "gdbthread.h"
 #include "gdb_bfd.h"
 
-#include "gdb_assert.h"
-
 #include "solist.h"
 #include "solib.h"
 #include "solib-svr4.h"
@@ -40,7 +38,6 @@
 #include "elf-bfd.h"
 #include "exec.h"
 #include "auxv.h"
-#include "exceptions.h"
 #include "mach-o.h"
 #include "mach-o/external.h"
 
@@ -524,26 +521,10 @@ darwin_solib_create_inferior_hook (int from_tty)
   load_addr = darwin_read_exec_load_addr (info);
   if (load_addr != 0 && symfile_objfile != NULL)
     {
-      CORE_ADDR vmaddr = 0;
-      struct mach_o_data_struct *md = bfd_mach_o_get_data (exec_bfd);
-      unsigned int i, num;
+      CORE_ADDR vmaddr;
 
       /* Find the base address of the executable.  */
-      for (i = 0; i < md->header.ncmds; i++)
-       {
-         struct bfd_mach_o_load_command *cmd = &md->commands[i];
-
-         if (cmd->type != BFD_MACH_O_LC_SEGMENT
-             && cmd->type != BFD_MACH_O_LC_SEGMENT_64)
-           continue;
-         if (cmd->command.segment.fileoff == 0
-             && cmd->command.segment.vmaddr != 0
-             && cmd->command.segment.filesize != 0)
-           {
-             vmaddr = cmd->command.segment.vmaddr;
-             break;
-           }
-       }
+      vmaddr = bfd_mach_o_get_base_address (exec_bfd);
 
       /* Relocate.  */
       if (vmaddr != load_addr)
@@ -589,7 +570,7 @@ darwin_relocate_section_addresses (struct so_list *so,
 }
 \f
 static struct symbol *
-darwin_lookup_lib_symbol (const struct objfile *objfile,
+darwin_lookup_lib_symbol (struct objfile *objfile,
                          const char *name,
                          const domain_enum domain)
 {
This page took 0.024731 seconds and 4 git commands to generate.