OSDN Git Service

mips64*-*-toppers* support.
[pf3gnuchains/pf3gnuchains3x.git] / bfd / netbsd-core.c
index 3c3cf0a..397f1d0 100644 (file)
@@ -1,6 +1,6 @@
 /* BFD back end for NetBSD style core files
    Copyright 1988, 1989, 1991, 1992, 1993, 1996, 1998, 1999, 2000, 2001,
-   2002, 2003, 2004, 2005
+   2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
    Written by Paul Kranenburg, EUR
 
@@ -8,7 +8,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02110-1301, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
 
-#include "bfd.h"
 #include "sysdep.h"
+#include "bfd.h"
 #include "libbfd.h"
 #include "libaout.h"           /* BFD a.out internal data structures.  */
 
@@ -42,6 +43,8 @@
    OpenBSD/sparc64.  */
 #define SPARC64_WCOOKIE_OFFSET 832
 
+#define netbsd_core_file_matches_executable_p generic_core_file_matches_executable_p
+
 struct netbsd_core_struct
 {
   struct core core;
@@ -124,11 +127,10 @@ netbsd_core_file_p (bfd *abfd)
          flags = SEC_ALLOC + SEC_HAS_CONTENTS;
          break;
        }
-      asect = bfd_make_section_anyway (abfd, sname);
+      asect = bfd_make_section_anyway_with_flags (abfd, sname, flags);
       if (asect == NULL)
        goto punt;
 
-      asect->flags = flags;
       asect->size = coreseg.c_size;
       asect->vma = coreseg.c_addr;
       asect->filepos = offset;
@@ -157,11 +159,12 @@ netbsd_core_file_p (bfd *abfd)
              asect->size = wcookie_offset;
 
              /* And create the .wcookie section.  */
-             asect = bfd_make_section_anyway (abfd, ".wcookie");
+             flags = SEC_ALLOC + SEC_HAS_CONTENTS;
+             asect = bfd_make_section_anyway_with_flags (abfd, ".wcookie",
+                                                         flags);
              if (asect == NULL)
                goto punt;
 
-             asect->flags = SEC_ALLOC + SEC_HAS_CONTENTS;
              asect->size = coreseg.c_size - wcookie_offset;
              asect->vma = 0;
              asect->filepos = offset + wcookie_offset;
@@ -246,14 +249,6 @@ netbsd_core_file_failing_signal (bfd *abfd)
   /*return core_signal (abfd);*/
   return abfd->tdata.netbsd_core_data->core.c_signo;
 }
-
-static bfd_boolean
-netbsd_core_file_matches_executable_p  (bfd *core_bfd ATTRIBUTE_UNUSED,
-                                       bfd *exec_bfd ATTRIBUTE_UNUSED)
-{
-  /* FIXME, We have no way of telling at this point.  */
-  return TRUE;
-}
 \f
 /* If somebody calls any byte-swapping routines, shoot them.  */