Created attachment 11417 [details] crt0.o for pdp11 Function dump_relocs_in_section in objdump.c checks that the relic count is valid by comparing the size of the reloc data against the file size. That check is incorrect because "relsize" is the decoded (canonical) reloc data size, not the size of the reloc data encoded in the file. In the case of pdp11, sizeof (arelent) is 8, while the size in the file is 2 bytes per entry, so the check can easily fail. The attached file shows the issue. If I comment out the check at objdump.c:3465, it works.
The master branch has been updated by Nick Clifton <nickc@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8936f76804c2908e4abe911441dd03641204df9d commit 8936f76804c2908e4abe911441dd03641204df9d Author: Nick Clifton <nickc@redhat.com> Date: Thu Nov 29 10:57:54 2018 +0000 objdump: Fix check for corrupt reloc information, to allow for the fact that PDP11 relocs are bigger when in internal format. PR 23931 * objdump.c (dump_relocs_in_section): When checking for an unreasonable amount of relocs in a bfd, allow for the fact that the internal representation of a reloc may be bigger than the external representation.
Hi Paul, Thanks for reporting this problem. Rather than disabling the check however, I thought it better to tweak it to allow for the fact that the internal representation of thr PDP11 relocs is larger than the external representation. Cheers Nick
Great. I agree fixing the check is best. I looked at the code but it wasn't clear to me how to do that, so I did the disable as a crude test.