* symfile.h (struct sym_fns): Add new field sym_read_linetable.
[deliverable/binutils-gdb.git] / gdb / solib-legacy.c
index ca730c4ad9b33df732b433846427d11823af3a05..e943ba539a1a1c7f1ca7ff15579c403b317d3b78 100644 (file)
@@ -1,12 +1,12 @@
 /* Provide legacy r_debug and link_map support for SVR4-like native targets.
-   Copyright 2000, 2001
-   Free Software Foundation, Inc.
+
+   Copyright (C) 2000, 2001, 2006, 2007 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#define _SYSCALL32     /* for Sparc64 cross Sparc32 */
 #include "defs.h"
 #include "gdbcore.h"
 #include "solib-svr4.h"
@@ -56,48 +53,36 @@ legacy_svr4_fetch_link_map_offsets (void)
       lmp = &lmo;
 
 #ifdef HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS
-      lmo.r_debug_size = sizeof (struct r_debug);
-
+      lmo.r_version_offset = offsetof (struct r_debug, r_version);
+      lmo.r_version_size = fieldsize (struct r_debug, r_version);
       lmo.r_map_offset = offsetof (struct r_debug, r_map);
-      lmo.r_map_size = fieldsize (struct r_debug, r_map);
+      lmo.r_ldsomap_offset = -1;
 
       lmo.link_map_size = sizeof (struct link_map);
 
       lmo.l_addr_offset = offsetof (struct link_map, l_addr);
-      lmo.l_addr_size = fieldsize (struct link_map, l_addr);
-
       lmo.l_next_offset = offsetof (struct link_map, l_next);
-      lmo.l_next_size = fieldsize (struct link_map, l_next);
-
+      lmo.l_ld_offset = offsetof (struct link_map, l_ld);
       lmo.l_prev_offset = offsetof (struct link_map, l_prev);
-      lmo.l_prev_size = fieldsize (struct link_map, l_prev);
-
       lmo.l_name_offset = offsetof (struct link_map, l_name);
-      lmo.l_name_size = fieldsize (struct link_map, l_name);
 #else /* !defined(HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS) */
 #ifdef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS
       lmo.link_map_size = sizeof (struct link_map);
 
       lmo.l_addr_offset = offsetof (struct link_map, lm_addr);
-      lmo.l_addr_size = fieldsize (struct link_map, lm_addr);
-
       lmo.l_next_offset = offsetof (struct link_map, lm_next);
-      lmo.l_next_size = fieldsize (struct link_map, lm_next);
-
+      /* FIXME: Is this the right field name, or is it available at all?  */
+      lmo.l_ld_offset = offsetof (struct link_map, lm_ld);
       lmo.l_name_offset = offsetof (struct link_map, lm_name);
-      lmo.l_name_size = fieldsize (struct link_map, lm_name);
 #else /* !defined(HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS) */
 #if HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS
       lmo.link_map_size = sizeof (struct so_map);
 
       lmo.l_addr_offset = offsetof (struct so_map, som_addr);
-      lmo.l_addr_size = fieldsize (struct so_map, som_addr);
-
       lmo.l_next_offset = offsetof (struct so_map, som_next);
-      lmo.l_next_size = fieldsize (struct so_map, som_next);
-
       lmo.l_name_offset = offsetof (struct so_map, som_path);
-      lmo.l_name_size = fieldsize (struct so_map, som_path);
+      /* FIXME: Is the address of the dynamic table available?  */
+      lmo.l_ld_offset = -1;
 #endif /* HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS */
 #endif /* HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS */
 #endif /* HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS */
@@ -108,24 +93,17 @@ legacy_svr4_fetch_link_map_offsets (void)
     {
       lmp32 = &lmo32;
 
-      lmo32.r_debug_size = sizeof (struct r_debug32);
-
+      lmo32.r_version_offset = offsetof (struct r_debug32, r_version);
+      lmo32.r_version_size = fieldsize (struct r_debug32, r_version);
       lmo32.r_map_offset = offsetof (struct r_debug32, r_map);
-      lmo32.r_map_size = fieldsize (struct r_debug32, r_map);
+      lmo32.r_ldsomap_offset = -1;
 
       lmo32.link_map_size = sizeof (struct link_map32);
 
       lmo32.l_addr_offset = offsetof (struct link_map32, l_addr);
-      lmo32.l_addr_size = fieldsize (struct link_map32, l_addr);
-
       lmo32.l_next_offset = offsetof (struct link_map32, l_next);
-      lmo32.l_next_size = fieldsize (struct link_map32, l_next);
-
       lmo32.l_prev_offset = offsetof (struct link_map32, l_prev);
-      lmo32.l_prev_size = fieldsize (struct link_map32, l_prev);
-
       lmo32.l_name_offset = offsetof (struct link_map32, l_name);
-      lmo32.l_name_size = fieldsize (struct link_map32, l_name);
     }
 #endif /* defined (HAVE_STRUCT_LINK_MAP32) */
 
@@ -135,7 +113,7 @@ legacy_svr4_fetch_link_map_offsets (void)
       if (bfd_get_arch_size (exec_bfd) == 32)
        return lmp32;
     }
-  if (TARGET_PTR_BIT == 32)
+  if (gdbarch_ptr_bit (current_gdbarch) == 32)
     return lmp32;
 #endif
   return lmp;
@@ -143,6 +121,8 @@ legacy_svr4_fetch_link_map_offsets (void)
 
 #endif /* HAVE_LINK_H */
 
+extern initialize_file_ftype _initialize_svr4_lm; /* -Wmissing-prototypes */
+
 void
 _initialize_svr4_lm (void)
 {
This page took 0.025873 seconds and 4 git commands to generate.