X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Fsco5-core.c;h=2eea7ff7c24f82914ababa3fc05411adde4c3c4f;hb=fd885f3a4d85dc33d794ca359ea91f31e3082717;hp=33592b2d3168c54f230d8f8d2e5b73b8c2e4a815;hpb=eea6121ac0cb22524c627017191ca09825e3d702;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/sco5-core.c b/bfd/sco5-core.c index 33592b2d31..2eea7ff7c2 100644 --- a/bfd/sco5-core.c +++ b/bfd/sco5-core.c @@ -1,26 +1,28 @@ /* BFD back end for SCO5 core files (U-area and raw sections) - Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, + 2010, 2011 Free Software Foundation, Inc. Written by Jouke Numan -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -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 -(at your option) any later version. + 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 3 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -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 02111-1307, USA. */ + 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., 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 */ @@ -31,8 +33,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include /* After a.out.h */ +#ifdef SCO5_CORE #include #include +#endif struct sco5_core_struct { @@ -47,8 +51,8 @@ static struct user *read_uarea PARAMS ((bfd *, int)); const bfd_target *sco5_core_file_p PARAMS ((bfd *abfd)); char *sco5_core_file_failing_command PARAMS ((bfd *abfd)); int sco5_core_file_failing_signal PARAMS ((bfd *abfd)); -bfd_boolean sco5_core_file_matches_executable_p - PARAMS ((bfd *core_bfd, bfd *exec_bfd)); +#define sco5_core_file_matches_executable_p generic_core_file_matches_executable_p +#define sco5_core_file_pid _bfd_nocore_core_file_pid static void swap_abort PARAMS ((void)); static asection * @@ -62,10 +66,9 @@ make_bfd_asection (abfd, name, flags, size, vma, filepos) { asection *asect; - asect = bfd_make_section_anyway (abfd, name); + asect = bfd_make_section_anyway_with_flags (abfd, name, flags); if (!asect) return NULL; - asect->flags = flags; asect->size = size; asect->vma = vma; asect->filepos = filepos; @@ -126,14 +129,11 @@ sco5_core_file_p (abfd) /* Read coreoffsets region at end of core (see core(FP)). */ { - FILE *stream = bfd_cache_lookup (abfd); struct stat statbuf; - if (fstat (fileno (stream), &statbuf) < 0) - { - bfd_set_error (bfd_error_system_call); - return NULL; - } + if (bfd_stat (abfd, &statbuf) < 0) + return NULL; + coresize = statbuf.st_size; } /* Last long in core is sizeof struct coreoffsets, read it */ @@ -346,14 +346,6 @@ sco5_core_file_failing_signal (ignore_abfd) : -1); } -bfd_boolean -sco5_core_file_matches_executable_p (core_bfd, exec_bfd) - bfd *core_bfd ATTRIBUTE_UNUSED; - bfd *exec_bfd ATTRIBUTE_UNUSED; -{ - return TRUE; /* FIXME, We have no way of telling at this point */ -} - /* If somebody calls any byte-swapping routines, shoot them. */ static void swap_abort () @@ -378,9 +370,10 @@ const bfd_target sco5_core_vec = HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - 0, /* symbol prefix */ - ' ', /* ar_pad_char */ - 16, /* ar_max_namelen */ + 0, /* symbol prefix */ + ' ', /* ar_pad_char */ + 16, /* ar_max_namelen */ + 0, /* match priority. */ NO_GET64, NO_GETS64, NO_PUT64, /* 64 bit data */ NO_GET, NO_GETS, NO_PUT, /* 32 bit data */ NO_GET, NO_GETS, NO_PUT, /* 16 bit data */