* target.h (struct target_ops): New member to_thread_architecture.
[deliverable/binutils-gdb.git] / gdb / solib-svr4.c
index cf42fcb78e150c2d541bba13192560f9ac9b5862..bb2cefc7ae71ea40521dd70958145e441530359d 100644 (file)
@@ -266,7 +266,7 @@ IGNORE_FIRST_LINK_MAP_ENTRY (struct so_list *so)
 
   /* Assume that everything is a library if the dynamic loader was loaded
      late by a static executable.  */
-  if (bfd_get_section_by_name (exec_bfd, ".dynamic") == NULL)
+  if (exec_bfd && bfd_get_section_by_name (exec_bfd, ".dynamic") == NULL)
     return 0;
 
   return extract_typed_address (so->lm_info->lm + lmo->l_prev_offset,
@@ -600,9 +600,13 @@ scan_dyntag (int dyntag, bfd *abfd, CORE_ADDR *ptr)
 
   if (abfd == NULL)
     return 0;
+
+  if (bfd_get_flavour (abfd) != bfd_target_elf_flavour)
+    return 0;
+
   arch_size = bfd_get_arch_size (abfd);
   if (arch_size == -1)
-   return 0;
+    return 0;
 
   /* Find the start address of the .dynamic section.  */
   sect = bfd_get_section_by_name (abfd, ".dynamic");
@@ -825,11 +829,7 @@ locate_base (struct svr4_info *info)
      though if we don't have some link map offsets to work with.  */
 
   if (info->debug_base == 0 && svr4_have_link_map_offsets ())
-    {
-      if (exec_bfd != NULL
-         && bfd_get_flavour (exec_bfd) == bfd_target_elf_flavour)
-       info->debug_base = elf_locate_base ();
-    }
+    info->debug_base = elf_locate_base ();
   return info->debug_base;
 }
 
@@ -1380,7 +1380,8 @@ enable_break (struct svr4_info *info)
          most cases.  */
       if (!load_addr_found)
        {
-         struct regcache *regcache = get_thread_regcache (inferior_ptid);
+         struct regcache *regcache
+           = get_thread_arch_regcache (inferior_ptid, target_gdbarch);
          load_addr = (regcache_read_pc (regcache)
                       - exec_entry_point (tmp_bfd, tmp_bfd_target));
        }
@@ -1517,7 +1518,8 @@ static void
 svr4_relocate_main_executable (void)
 {
   asection *interp_sect;
-  struct regcache *regcache = get_thread_regcache (inferior_ptid);
+  struct regcache *regcache
+    = get_thread_arch_regcache (inferior_ptid, target_gdbarch);
   CORE_ADDR pc = regcache_read_pc (regcache);
 
   /* Decide if the objfile needs to be relocated.  As indicated above,
@@ -1747,7 +1749,7 @@ svr4_truncate_ptr (CORE_ADDR addr)
 
 static void
 svr4_relocate_section_addresses (struct so_list *so,
-                                 struct section_table *sec)
+                                 struct target_section *sec)
 {
   sec->addr    = svr4_truncate_ptr (sec->addr    + LM_ADDR_CHECK (so,
                                                                  sec->bfd));
This page took 0.025742 seconds and 4 git commands to generate.