* config/tc-ppc.c (ppc_frob_symbol): Formatting, warning fix.
[deliverable/binutils-gdb.git] / gdb / solib-legacy.c
index e6507f20e4001d930def2174401ef1c6b909b266..2dd9fa5fd023843b58755c021de405b0ac2aaa4b 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,11 +129,15 @@ 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 */
This page took 0.024273 seconds and 4 git commands to generate.