From 4a8309436d6f3a14be3dcc46e6fead5c4de73bc8 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 18 Apr 2008 09:22:24 +0000 Subject: * aix5ppc-core.c: Define macros for the default architecture and machine for matching core files. (xcoff64_core_p): Set the architecture and machine to the default values defined in the macros mentioned above. * rs6000-core.c: Define macros to determine whether or not the core file header uses the core_dumpxx header format. (rs6000coff_core_p): Don't match core files that use the core_dumpxx header format. --- bfd/rs6000-core.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'bfd/rs6000-core.c') diff --git a/bfd/rs6000-core.c b/bfd/rs6000-core.c index eb0eb522785..ad7bef9e10a 100644 --- a/bfd/rs6000-core.c +++ b/bfd/rs6000-core.c @@ -1,6 +1,6 @@ /* IBM RS/6000 "XCOFF" back-end for BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, - 2001, 2002, 2004, 2006, 2007 + 2001, 2002, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Metin G. Ozisik, Mimi Phuong-Thao Vo, and John Gilmore. Archive support from Damon A. Permezel. @@ -136,6 +136,19 @@ typedef union { # define CORE_NEW(c) 0 #endif +/* Return whether CoreHdr C usese core_dumpxx structure. + + FIXME: the core file format version number used here definitely indicates + that struct core_dumpxx should be used to represent the core file header, + but that may not be the only such format version number. */ + +#ifdef AIX_5_CORE +# define CORE_DUMPXX_VERSION 267312562 +# define CNEW_IS_CORE_DUMPXX(c) ((c).new.c_version == CORE_DUMPXX_VERSION) +#else +# define CNEW_IS_CORE_DUMPXX(c) 0 +#endif + /* Return the c_stackorg field from struct core_dumpx C. */ #ifdef AIX_CORE_DUMPX_CORE @@ -329,6 +342,13 @@ rs6000coff_core_p (bfd *abfd) return NULL; } + /* This isn't the right handler for 64-bit core files on AIX 5.x. */ + if (CORE_NEW (core) && CNEW_IS_CORE_DUMPXX (core)) + { + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + /* Copy fields from new or old core structure. */ if (CORE_NEW (core)) { -- cgit v1.2.1