gdb/
[deliverable/binutils-gdb.git] / gdb / solib-som.c
index 6dc5d140a78df2c7675572a2f14ac7bbdd028425..6100cbe6748f83fb7803d8f63a3817dcff16eb6b 100644 (file)
@@ -1,7 +1,6 @@
 /* Handle SOM shared libraries.
 
-   Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 2004-2005, 2007-2012 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -32,7 +31,6 @@
 #include "solib.h"
 #include "solib-som.h"
 
-#include <sys/utsname.h>
 #include <string.h>
 
 #undef SOLIB_SOM_DBG 
@@ -131,24 +129,23 @@ som_relocate_section_addresses (struct so_list *so,
     ;
 }
 
-/* Get HP-UX major release number.  Returns zero if the
-   release is not known.  */
 
-static int
-get_hpux_major_release (void)
-{
-  static int hpux_major_release = -1;
+/* Variable storing HP-UX major release number.
 
-  if (hpux_major_release == -1)
-    {
-      struct utsname x;
-      char *p;
+   On non-native system, simply assume that the major release number
+   is 11.  On native systems, hppa-hpux-nat.c initialization code
+   sets this number to the real one on startup.
+   
+   We cannot compute this value here, because we need to make a native
+   call to "uname".  We are are not allowed to do that from here, as
+   this file is used for both native and cross debugging.  */
 
-      uname (&x);
-      p = strchr (x.release, '.');
-      hpux_major_release = p ? atoi (p + 1) : 0;
-    }
+#define DEFAULT_HPUX_MAJOR_RELEASE 11
+int hpux_major_release = DEFAULT_HPUX_MAJOR_RELEASE;
 
+static int
+get_hpux_major_release (void)
+{
   return hpux_major_release;
 }
 
This page took 0.024028 seconds and 4 git commands to generate.