Remove BFD64 checks from rs6000-core.c

Aditya Kamath Aditya.Kamath1@ibm.com
Fri Jul 31 07:16:37 GMT 2026


Hi Alan,

>You might like to test this patch for me.
>On a 32-bit system it is possible to build binutils with
>--enable-64-bit-bfd or with --enable-targets choosing extra targets
>that require a 64-bit bfd.  So all of the BFD64 tests added in commit
>d6867a7559 and further modified in commit f03265d9cd are bogus, in
>particular the removal of code by #ifndef BFD64.  It looks to me that
>this would break reading of core files in rs6000-aix4.2 or earlier.

chdev -l sys0 -a pre430core=true
lsattr -El sys0 | grep pre430core    # should say 'true'
sys0 changed
pre430core      true                                 Use pre-430 style CORE dump                         True

gcc -maix64 -o /tmp/bfdtest_orig /tmp/bfdtest.c \
  -include /home/aditya/binutils-gdb/bfd/config.h \
  -I/home/aditya/binutils-gdb/bfd \
  -I/home/aditya/binutils-gdb/include \
  /home/aditya/binutils-gdb/bfd/*.o \
  /home/aditya/binutils-gdb/libiberty/libiberty.a \
  -L/opt/freeware/lib64 \
  -lz -lzstd -lintl -lpthread

/tmp/bfdtest_orig /tmp/core
/tmp/core: not recognised as a core file: file format not recognized

Yes it was breaking reading core files.


After using the fix you provided as attached in this email [ See: diff.patch ] we get,
gcc -maix64 -o /tmp/bfdtest /tmp/bfdtest.c \
  -include /home/aditya/binutils-gdb/bfd/config.h \
  -I/home/aditya/binutils-gdb/bfd \
  -I/home/aditya/binutils-gdb/include \
  /home/aditya/binutils-gdb/bfd/*.o \
  /home/aditya/binutils-gdb/libiberty/libiberty.a \
  -L/opt/freeware/lib64 \
  -lz -lzstd -lintl -lpthread
bash-5.3# /tmp/bfdtest /tmp/core
Format : aixcoff-rs6000
Failing command: crashme
Failing signal : 6
Sections:
  .stack        size=0x1000  vma=0x2ff22000  filepos=0x48f6
  .reg          size=0x250  vma=0x0  filepos=0x10
  .ldinfo       size=0x7ffffff  vma=0x0  filepos=0x4840

So your fix works.

Thanks for reaching out.

Regards,
Aditya.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/binutils/attachments/20260731/eceff0e0/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff.patch
Type: application/octet-stream
Size: 5577 bytes
Desc: diff.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20260731/eceff0e0/attachment-0001.obj>


More information about the Binutils mailing list