aboutsummaryrefslogtreecommitdiff
path: root/contrib/binutils/bfd/sco5-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/binutils/bfd/sco5-core.c')
-rw-r--r--contrib/binutils/bfd/sco5-core.c35
1 files changed, 12 insertions, 23 deletions
diff --git a/contrib/binutils/bfd/sco5-core.c b/contrib/binutils/bfd/sco5-core.c
index 5c34ff1b5562..9a06b8839f54 100644
--- a/contrib/binutils/bfd/sco5-core.c
+++ b/contrib/binutils/bfd/sco5-core.c
@@ -1,5 +1,5 @@
/* 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
Free Software Foundation, Inc.
Written by Jouke Numan <jnuman@hiscom.nl>
@@ -17,7 +17,7 @@ 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. */
+Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -31,8 +31,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <signal.h>
#include <sys/user.h> /* After a.out.h */
+#ifdef SCO5_CORE
#include <sys/paccess.h>
#include <sys/region.h>
+#endif
struct sco5_core_struct
{
@@ -47,16 +49,15 @@ 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 *
-make_bfd_asection (abfd, name, flags, _raw_size, vma, filepos)
+make_bfd_asection (abfd, name, flags, size, vma, filepos)
bfd *abfd;
const char *name;
flagword flags;
- bfd_size_type _raw_size;
+ bfd_size_type size;
bfd_vma vma;
file_ptr filepos;
{
@@ -66,7 +67,7 @@ make_bfd_asection (abfd, name, flags, _raw_size, vma, filepos)
if (!asect)
return NULL;
asect->flags = flags;
- asect->_raw_size = _raw_size;
+ asect->size = size;
asect->vma = vma;
asect->filepos = filepos;
asect->alignment_power = 2;
@@ -123,18 +124,14 @@ sco5_core_file_p (abfd)
char *secname;
flagword flags;
- /* Read coreoffsets region at end of core (see core(FP)) */
+ /* Read coreoffsets region at end of core (see core(FP)). */
{
- FILE *stream = bfd_cache_lookup (abfd);
struct stat statbuf;
- if (stream == NULL)
+
+ if (bfd_stat (abfd, &statbuf) < 0)
return NULL;
- if (fstat (fileno (stream), &statbuf) < 0)
- {
- bfd_set_error (bfd_error_system_call);
- return NULL;
- }
+
coresize = statbuf.st_size;
}
/* Last long in core is sizeof struct coreoffsets, read it */
@@ -347,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 ()