Fix potential segfault
[deliverable/binutils-gdb.git] / bfd / elfcore.h
index 591ca531a6325d44f59059232adb0df1db393b71..0339a671fc7fdb7371d3771581870a107ec00eeb 100644 (file)
@@ -61,9 +61,9 @@ elf_core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd)
   corename = elf_tdata (core_bfd)->core->program;
   if (corename != NULL)
     {
-      const char* execname = strrchr (exec_bfd->filename, '/');
+      const char* execname = strrchr (bfd_get_filename (exec_bfd), '/');
 
-      execname = execname ? execname + 1 : exec_bfd->filename;
+      execname = execname ? execname + 1 : bfd_get_filename (exec_bfd);
 
       if (strcmp (execname, corename) != 0)
        return FALSE;
@@ -83,7 +83,7 @@ elf_core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd)
     that allow standard bfd access to the general registers (.reg) and the
     floating point registers (.reg2).  */
 
-const bfd_target *
+bfd_cleanup
 elf_core_file_p (bfd *abfd)
 {
   Elf_External_Ehdr x_ehdr;    /* Elf file header, external form.  */
@@ -314,7 +314,7 @@ elf_core_file_p (bfd *abfd)
 
   /* Save the entry point from the ELF header.  */
   abfd->start_address = i_ehdrp->e_entry;
-  return abfd->xvec;
+  return _bfd_no_cleanup;
 
  wrong:
   bfd_set_error (bfd_error_wrong_format);
This page took 0.024363 seconds and 4 git commands to generate.