[binutils-gdb] Add support to recognise 32 bit core file formats in AIX 7.3
Alan Modra
amodra@sourceware.org
Fri Jul 31 08:30:21 GMT 2026
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=50c8bd0f88de6522f1308807062d19cbb5b61538
commit 50c8bd0f88de6522f1308807062d19cbb5b61538
Author: Aditya Kamath <Aditya.Kamath1@ibm.com>
Date: Fri Jul 31 12:49:27 2026 +0530
Add support to recognise 32 bit core file formats in AIX 7.3
In AIX 7.3 when we take core dump and analyse we get,
gdb/gdb /tmp/crash32 -c /tmp/core
...
Reading symbols from /tmp/crash32...
"/tmp/core" is not a core dump: file format not recognized
The reason being BFD is not able to recognise the same.
Diff:
---
bfd/rs6000-core.c | 26 ++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/bfd/rs6000-core.c b/bfd/rs6000-core.c
index 287738609e7..89da485fbc6 100644
--- a/bfd/rs6000-core.c
+++ b/bfd/rs6000-core.c
@@ -143,7 +143,10 @@ typedef union
#ifdef AIX_5_CORE
# define CORE_DUMPXX_VERSION 267312562
-# define CNEW_IS_CORE_DUMPXX(c) ((c).new_dump.c_version == CORE_DUMPXX_VERSION)
+# define CORE_DUMPXX_VERSION_AIX73 267312561
+# define CNEW_IS_CORE_DUMPXX(c) \
+ ((c).new_dump.c_version == CORE_DUMPXX_VERSION \
+ || (c).new_dump.c_version == CORE_DUMPXX_VERSION_AIX73)
#else
# define CNEW_IS_CORE_DUMPXX(c) 0
#endif
@@ -340,11 +343,19 @@ rs6000coff_core_p (bfd *abfd)
return NULL;
}
- /* This isn't the right handler for 64-bit core files on AIX 5.x. */
+ /* This isn't the right handler for 64-bit core files on AIX 5.x.
+ However, 32-bit processes on AIX 7.x can produce core_dumpxx format
+ cores with version 0xfeeddb1, which we need to handle here.
+ The aix5ppc-core.c handler will catch 64-bit cores. */
if (CORE_NEW (core) && CNEW_IS_CORE_DUMPXX (core))
{
- bfd_set_error (bfd_error_wrong_format);
- return NULL;
+ /* Check if this is a 64-bit process core. */
+ if (CNEW_PROC64 (core.new_dump))
+ {
+ /* Let aix5ppc-core.c handle 64-bit cores. */
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
}
/* Copy fields from new or old core structure. */
@@ -424,8 +435,11 @@ rs6000coff_core_p (bfd *abfd)
}
/* Don't check the core file size for a full core, AIX 4.1 includes
- additional shared library sections in a full core. */
- if (!(c_flag & (FULL_CORE | CORE_TRUNC)))
+ additional shared library sections in a full core.
+ Also skip the check for AIX 7.3 32-bit cores in core_dumpxx format,
+ as they may have additional sections beyond c_stack + c_size. */
+ if (!(c_flag & (FULL_CORE | CORE_TRUNC))
+ && !(CORE_NEW (core) && CNEW_IS_CORE_DUMPXX (core) && !proc64))
{
/* If the size is wrong, it means we're misinterpreting something. */
if (c_stack + (file_ptr) c_size != statbuf.st_size)
More information about the Binutils-cvs
mailing list