diff -rc src.orig/bfd/ChangeLog src/bfd/ChangeLog *** src.orig/bfd/ChangeLog Mon Apr 14 12:58:48 2008 --- src/bfd/ChangeLog Tue Apr 15 13:30:07 2008 *************** *** 1,3 **** --- 1,14 ---- + 2008-04-15 Dennis Roberts + + * 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. + 2008-04-14 Aurelien Jarno * configure.in: Link with the PIC version of libiberty on diff -rc src.orig/bfd/aix5ppc-core.c src/bfd/aix5ppc-core.c *** src.orig/bfd/aix5ppc-core.c Tue Jul 3 07:26:39 2007 --- src/bfd/aix5ppc-core.c Tue Apr 15 13:33:11 2008 *************** *** 40,45 **** --- 40,49 ---- #include #include + /* The default architecture and machine for matching core files. */ + #define DEFAULT_ARCHITECTURE bfd_arch_powerpc + #define DEFAULT_MACHINE bfd_mach_ppc_620 + #define core_hdr(abfd) ((struct core_dumpxx *) abfd->tdata.any) #define CHECK_FILE_OFFSET(s, v) \ *************** *** 48,53 **** --- 52,59 ---- const bfd_target * xcoff64_core_p (bfd *abfd) { + enum bfd_architecture arch; + unsigned long mach; struct core_dumpxx core, *new_core_hdr; struct stat statbuf; asection *sec; *************** *** 217,222 **** --- 223,233 ---- sec->filepos = vminfo.vminfo_offset; } } + + /* Set the architecture and machine. */ + arch = DEFAULT_ARCHITECTURE; + mach = DEFAULT_MACHINE; + bfd_default_set_arch_mach (abfd, arch, mach); return_value = (bfd_target *) abfd->xvec; /* This is garbage for now. */ diff -rc src.orig/bfd/rs6000-core.c src/bfd/rs6000-core.c *** src.orig/bfd/rs6000-core.c Tue Jul 3 07:26:42 2007 --- src/bfd/rs6000-core.c Tue Apr 15 13:33:10 2008 *************** *** 136,141 **** --- 136,154 ---- # 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 *************** *** 326,331 **** --- 339,351 ---- { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); + 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; } diff -rc src.orig/gdb/ChangeLog src/gdb/ChangeLog *** src.orig/gdb/ChangeLog Mon Apr 14 12:47:28 2008 --- src/gdb/ChangeLog Tue Apr 15 13:32:36 2008 *************** *** 1,3 **** --- 1,8 ---- + 2008-04-15 Dennis Roberts + + * rs6000-tdep.c (rs6000_gdbarch_init): Use the BFD architecture, + rather than a hard-coded architecture, for xcoff executables. + 2008-04-14 Daniel Jacobowitz * Makefile.in (GNULIB_H): New. Trigger all-lib. diff -rc src.orig/gdb/rs6000-tdep.c src/gdb/rs6000-tdep.c *** src.orig/gdb/rs6000-tdep.c Wed Feb 20 07:34:43 2008 --- src/gdb/rs6000-tdep.c Tue Apr 15 13:33:10 2008 *************** *** 3307,3324 **** wordsize = 4; } ! if (!from_xcoff_exec) ! { ! arch = info.bfd_arch_info->arch; ! mach = info.bfd_arch_info->mach; ! } ! else ! { ! arch = bfd_arch_powerpc; ! bfd_default_set_arch_mach (&abfd, arch, 0); ! info.bfd_arch_info = bfd_get_arch_info (&abfd); ! mach = info.bfd_arch_info->mach; ! } /* For e500 executables, the apuinfo section is of help here. Such section contains the identifier and revision number of each --- 3307,3315 ---- wordsize = 4; } ! /* Get the architecture and machine from the BFD. */ ! arch = info.bfd_arch_info->arch; ! mach = info.bfd_arch_info->mach; /* For e500 executables, the apuinfo section is of help here. Such section contains the identifier and revision number of each