+ Read in a copy of the requested member in the inferior's dynamic
+ link map from the inferior's dynamic linker structures, and fill
+ in the necessary so_list_ptr elements.
+ */
+
+static void
+xfer_link_map_member (so_list_ptr, lm)
+ struct so_list *so_list_ptr;
+ struct link_map *lm;
+{
+ struct obj_list list_old;
+ CORE_ADDR lladdr = lm->l_lladdr;
+ struct link_map *new_lm = &so_list_ptr->lm;
+ int errcode;
+
+ read_memory (lladdr, (char *) &list_old, sizeof (struct obj_list));
+
+ new_lm->l_variant = OBJ_LIST_OLD;
+ new_lm->l_lladdr = lladdr;
+ new_lm->l_next = (CORE_ADDR) list_old.next;
+
+#ifdef HANDLE_NEW_OBJ_LIST
+ if (list_old.data == NEW_OBJ_INFO_MAGIC)
+ {
+ Elf32_Obj_Info list_32;
+
+ read_memory (lladdr, (char *) &list_32, sizeof (Elf32_Obj_Info));
+ if (list_32.oi_size != sizeof (Elf32_Obj_Info))
+ return;
+ new_lm->l_variant = OBJ_LIST_32;
+ new_lm->l_next = (CORE_ADDR) list_32.oi_next;
+
+ target_read_string ((CORE_ADDR) list_32.oi_pathname,
+ &so_list_ptr->so_name,
+ list_32.oi_pathname_len + 1, &errcode);
+ if (errcode != 0)
+ memory_error (errcode, (CORE_ADDR) list_32.oi_pathname);
+
+ LM_ADDR (so_list_ptr) = (CORE_ADDR) list_32.oi_ehdr;
+ LM_OFFSET (so_list_ptr) =
+ (CORE_ADDR) list_32.oi_ehdr - (CORE_ADDR) list_32.oi_orig_ehdr;
+ }
+ else
+#endif
+ {
+#if defined (_MIPS_SIM_NABI32) && _MIPS_SIM == _MIPS_SIM_NABI32
+ /* If we are compiling GDB under N32 ABI, the alignments in
+ the obj struct are different from the O32 ABI and we will get
+ wrong values when accessing the struct.
+ As a workaround we use fixed values which are good for
+ Irix 6.2. */
+ char buf[432];
+
+ read_memory ((CORE_ADDR) list_old.data, buf, sizeof (buf));
+
+ target_read_string (extract_address (&buf[236], 4),
+ &so_list_ptr->so_name,
+ INT_MAX, &errcode);
+ if (errcode != 0)
+ memory_error (errcode, extract_address (&buf[236], 4));
+
+ LM_ADDR (so_list_ptr) = extract_address (&buf[196], 4);
+ LM_OFFSET (so_list_ptr) =
+ extract_address (&buf[196], 4) - extract_address (&buf[248], 4);
+#else
+ struct obj obj_old;
+
+ read_memory ((CORE_ADDR) list_old.data, (char *) &obj_old,
+ sizeof (struct obj));
+
+ target_read_string ((CORE_ADDR) obj_old.o_path,
+ &so_list_ptr->so_name,
+ INT_MAX, &errcode);
+ if (errcode != 0)
+ memory_error (errcode, (CORE_ADDR) obj_old.o_path);
+
+ LM_ADDR (so_list_ptr) = (CORE_ADDR) obj_old.o_praw;
+ LM_OFFSET (so_list_ptr) =
+ (CORE_ADDR) obj_old.o_praw - obj_old.o_base_address;
+#endif
+ }
+
+ catch_errors (solib_map_sections, (char *) so_list_ptr,
+ "Error while mapping shared library sections:\n",
+ RETURN_MASK_ALL);
+}
+
+
+/*
+
+ LOCAL FUNCTION
+
+ find_solib -- step through list of shared objects
+
+ SYNOPSIS
+
+ struct so_list *find_solib (struct so_list *so_list_ptr)
+
+ DESCRIPTION
+
+ This module contains the routine which finds the names of any
+ loaded "images" in the current process. The argument in must be
+ NULL on the first call, and then the returned value must be passed
+ in on subsequent calls. This provides the capability to "step" down
+ the list of loaded objects. On the last object, a NULL value is
+ returned.