X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Fsco5-core.c;h=4b85fa5e6f16328cf315587cc73e6653e43ca98b;hb=d2c7a1a63b98c1add3d78ba71ffa9f2a105c1cd4;hp=33592b2d3168c54f230d8f8d2e5b73b8c2e4a815;hpb=eea6121ac0cb22524c627017191ca09825e3d702;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/sco5-core.c b/bfd/sco5-core.c index 33592b2d31..4b85fa5e6f 100644 --- a/bfd/sco5-core.c +++ b/bfd/sco5-core.c @@ -1,26 +1,27 @@ /* 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 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 +32,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 +50,7 @@ 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 static void swap_abort PARAMS ((void)); static asection * @@ -62,10 +64,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 +127,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 +344,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 ()