* elf.c (bfd_section_from_shdr): Remove extraneous breaks.
[deliverable/binutils-gdb.git] / bfd / cisco-core.c
index b7f735b59deeab674988b83e82b84fb4d6aacffd..7d63118aef608b6d74ebcdbf5658ab49720a2178 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for CISCO crash dumps.
-   Copyright 1994, 1997, 1999, 2000, 2001, 2002, 2004
+   Copyright 1994, 1997, 1999, 2000, 2001, 2002, 2004, 2006
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -95,6 +95,7 @@ cisco_core_file_validate (abfd, crash_info_loc)
   sec_ptr asect;
   struct stat statbuf;
   bfd_size_type amt;
+  flagword flags;
 
   if (bfd_seek (abfd, (file_ptr) crash_info_loc, SEEK_SET) != 0)
     return NULL;
@@ -241,10 +242,10 @@ cisco_core_file_validate (abfd, crash_info_loc)
   /* Create a ".data" section that maps the entire file, which is
      essentially a dump of the target system's RAM.  */
 
-  asect = bfd_make_section_anyway (abfd, ".data");
+  flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
+  asect = bfd_make_section_anyway_with_flags (abfd, ".data", flags);
   if (asect == NULL)
     goto error_return;
-  asect->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
   /* The size of memory is the size of the core file itself.  */
   asect->size = statbuf.st_size;
   asect->vma = rambase;
@@ -253,10 +254,10 @@ cisco_core_file_validate (abfd, crash_info_loc)
   /* Create a ".crash" section to allow access to the saved
      crash information.  */
 
-  asect = bfd_make_section_anyway (abfd, ".crash");
+  flags = SEC_HAS_CONTENTS;
+  asect = bfd_make_section_anyway_with_flags (abfd, ".crash", flags);
   if (asect == NULL)
     goto error_return;
-  asect->flags = SEC_HAS_CONTENTS;
   asect->vma = 0;
   asect->filepos = crashinfo_offset;
   asect->size = sizeof (crashinfo);
@@ -264,10 +265,9 @@ cisco_core_file_validate (abfd, crash_info_loc)
   /* Create a ".reg" section to allow access to the saved
      registers.  */
 
-  asect = bfd_make_section_anyway (abfd, ".reg");
+  asect = bfd_make_section_anyway_with_flags (abfd, ".reg", flags);
   if (asect == NULL)
     goto error_return;
-  asect->flags = SEC_HAS_CONTENTS;
   asect->vma = 0;
   asect->filepos = bfd_get_32 (abfd, crashinfo.registers) - rambase;
   /* Since we don't know the exact size of the saved register info,
This page took 0.024189 seconds and 4 git commands to generate.