* gdb.ada/taft_type/pck.ads, gdb.ada/taft_type/pck.adb,
[deliverable/binutils-gdb.git] / gdb / i386-nto-tdep.c
index 19729b6dea2fe51843dbbfb2e4d254ab1c5e9de7..61afa06658ab117b24f8f03705904eae5792a01b 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for QNX Neutrino x86.
 
-   Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
 
    Contributed by QNX Software Systems Ltd.
 
@@ -31,6 +31,7 @@
 #include "i386-tdep.h"
 #include "i387-tdep.h"
 #include "nto-tdep.h"
+#include "solib.h"
 #include "solib-svr4.h"
 
 /* Target vector for QNX NTO x86.  */
@@ -251,6 +252,7 @@ static void
 i386nto_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  static struct target_so_ops nto_svr4_so_ops;
 
   /* Deal with our strange signals.  */
   nto_initialize_signals ();
@@ -277,14 +279,25 @@ i386nto_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_solib_svr4_fetch_link_map_offsets
     (gdbarch, svr4_ilp32_fetch_link_map_offsets);
 
-  /* Our loader handles solib relocations slightly differently than svr4.  */
-  TARGET_SO_RELOCATE_SECTION_ADDRESSES = nto_relocate_section_addresses;
+  /* Initialize this lazily, to avoid an initialization order
+     dependency on solib-svr4.c's _initialize routine.  */
+  if (nto_svr4_so_ops.in_dynsym_resolve_code == NULL)
+    {
+      nto_svr4_so_ops = svr4_so_ops;
+
+      /* Our loader handles solib relocations differently than svr4.  */
+      nto_svr4_so_ops.relocate_section_addresses
+        = nto_relocate_section_addresses;
 
-  /* Supply a nice function to find our solibs.  */
-  TARGET_SO_FIND_AND_OPEN_SOLIB = nto_find_and_open_solib;
+      /* Supply a nice function to find our solibs.  */
+      nto_svr4_so_ops.find_and_open_solib
+        = nto_find_and_open_solib;
 
-  /* Our linker code is in libc.  */
-  TARGET_SO_IN_DYNSYM_RESOLVE_CODE = nto_in_dynsym_resolve_code;
+      /* Our linker code is in libc.  */
+      nto_svr4_so_ops.in_dynsym_resolve_code
+        = nto_in_dynsym_resolve_code;
+    }
+  set_solib_ops (gdbarch, &nto_svr4_so_ops);
 
   nto_set_target (&i386_nto_target);
 }
This page took 0.02394 seconds and 4 git commands to generate.