* gdb.texinfo (Command Files): Move the description of the startup
[deliverable/binutils-gdb.git] / gdb / solib-legacy.c
index e6507f20e4001d930def2174401ef1c6b909b266..a87eb21511ab9408c25f2befd2d42c0864c0c48b 100644 (file)
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define _SYSCALL32     /* for Sparc64 cross Sparc32 */
 #include "defs.h"
 #include "gdbcore.h"
 #include "solib-svr4.h"
 
 #ifdef HAVE_LINK_H
+
+#ifdef HAVE_NLIST_H
+/* nlist.h needs to be included before link.h on some older *BSD systems. */
+#include <nlist.h>
+#endif
+
 #include <link.h>
 
 /* Fetch (and possibly build) an appropriate link_map_offsets structure
@@ -124,15 +129,21 @@ legacy_svr4_fetch_link_map_offsets (void)
 #endif /* defined (HAVE_STRUCT_LINK_MAP32) */
 
 #if defined (HAVE_STRUCT_LINK_MAP32)
-  if (bfd_get_arch_size (exec_bfd) == 32)
+  if (exec_bfd != NULL)
+    {
+      if (bfd_get_arch_size (exec_bfd) == 32)
+       return lmp32;
+    }
+  if (TARGET_PTR_BIT == 32)
     return lmp32;
-  else
 #endif
-    return lmp;
+  return lmp;
 }
 
 #endif /* HAVE_LINK_H */
 
+extern initialize_file_ftype _initialize_svr4_lm; /* -Wmissing-prototypes */
+
 void
 _initialize_svr4_lm (void)
 {
This page took 0.042613 seconds and 4 git commands to generate.