Index: gdb/solib-svr4.c =================================================================== RCS file: /cvs/src/src/gdb/solib-svr4.c,v retrieving revision 1.100 diff -u -p -r1.100 solib-svr4.c --- gdb/solib-svr4.c 22 May 2009 23:49:13 -0000 1.100 +++ gdb/solib-svr4.c 29 May 2009 20:34:49 -0000 @@ -266,7 +266,7 @@ IGNORE_FIRST_LINK_MAP_ENTRY (struct so_l /* 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, @@ -826,8 +826,10 @@ locate_base (struct svr4_info *info) if (info->debug_base == 0 && svr4_have_link_map_offsets ()) { - if (exec_bfd != NULL + if ((exec_bfd != NULL && bfd_get_flavour (exec_bfd) == bfd_target_elf_flavour) + || (core_bfd != NULL + && bfd_get_flavour (core_bfd) == bfd_target_elf_flavour)) info->debug_base = elf_locate_base (); } return info->debug_base;