/* 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.
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;
/* 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;
/* 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);
/* 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,