/* 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,
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");
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;
}
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));
}
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,
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));