* stabs.c (_bfd_link_section_stabs): Use bfd_make_section*_with_flags
[deliverable/binutils-gdb.git] / bfd / ptrace-core.c
index 4ac28aa1dece59ff7f0a2632d6902f71b3211b78..8b4a86b02d601a4009696b9d856c28a8ad33e54c 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD backend for core files which use the ptrace_user structure
-   Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004
+   Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004, 2006
    Free Software Foundation, Inc.
    The structure of this file is based on trad-core.c written by John Gilmore
    of Cygnus Support.
@@ -63,6 +63,7 @@ ptrace_unix_core_file_p (abfd)
   struct ptrace_user u;
   struct trad_core_struct *rawptr;
   bfd_size_type amt;
+  flagword flags;
 
   val = bfd_bread ((void *)&u, (bfd_size_type) sizeof u, abfd);
   if (val != sizeof u || u.pt_magic != _BCS_PTRACE_MAGIC
@@ -89,13 +90,17 @@ ptrace_unix_core_file_p (abfd)
 
   /* Create the sections.  */
 
-  core_stacksec (abfd) = bfd_make_section_anyway (abfd, ".stack");
+  flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
+  core_stacksec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".stack",
+                                                            flags);
   if (core_stacksec (abfd) == NULL)
     goto fail;
-  core_datasec (abfd) = bfd_make_section_anyway (abfd, ".data");
+  core_datasec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".data",
+                                                           flags);
   if (core_datasec (abfd) == NULL)
     goto fail;
-  core_regsec (abfd) = bfd_make_section_anyway (abfd, ".reg");
+  core_regsec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".reg",
+                                                          SEC_HAS_CONTENTS);
   if (core_regsec (abfd) == NULL)
     goto fail;
 
@@ -103,10 +108,6 @@ ptrace_unix_core_file_p (abfd)
      text.  I don't think that any of these things are supported on the
      system on which I am developing this for though.  */
 
-  core_stacksec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
-  core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
-  core_regsec (abfd)->flags = SEC_HAS_CONTENTS;
-
   core_datasec (abfd)->size =  u.pt_dsize;
   core_stacksec (abfd)->size = u.pt_ssize;
   core_regsec (abfd)->size = sizeof (u);
This page took 0.02352 seconds and 4 git commands to generate.