After upgrading binutils to 2.27 on the powerpcspe buildds in Debian, running the strip command fails with: (sid2-powerpcspe-sbuild)root@atlantis:/build/tcpdump-t4oxHH/tcpdump-4.7.4# strip --remove-section=.comment --remove-section=.note debian/tcpdump/usr/sbin/tcpdump strip: debian/tcpdump/usr/sbin/stMmiNLY: Not enough room for program headers, try linking with -N strip:debian/tcpdump/usr/sbin/stMmiNLY[.interp]: Bad value (sid2-powerpcspe-sbuild)root@atlantis:/build/tcpdump-t4oxHH/tcpdump-4.7.4 This problem is immediately resolved by downgrading binutils to 2.26.1 and rebuilding the package. The full build root for the test package tcpdump can be found in [1]. The full build log in [2]. Adrian > [1] https://people.debian.org/~glaubitz/tcpdump_ppcspe_debug.tgz > [2] https://buildd.debian.org/status/fetch.php?pkg=tcpdump&arch=powerpcspe&ver=4.7.4-2&stamp=1472415288
James Clarke (CC'ed) suggested this might be related to the following change [1]: > Use size_t rather than bfd_size_type > > I noticed when writing _bfd_elf_strtab_save/restore that size_t would > be better than bfd_size_type for a number of things in elf-strtab.c. > Using a 64-bit bfd_size_type on a 32-bit host doesn't make much sense > for array sizes and indices. > [1] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=ef53be89160126f2fa5dec8f1ec3bd6d99fb0681
I could not reproduce this problem using FSF binutils-2.27 or current git master source. I built both 32-bit and 64-bit binutils binaries to test the assertion that the size_t change was at fault. strip ran fine on tcpdump-t4oxHH/tcpdump-4.7.4/tcpdump from [1], producing the same binary as tcpdump-t4oxHH/tcpdump-4.7.4/debian/tcpdump/usr/sbin/tcpdump without reporting any errors.
(In reply to Alan Modra from comment #2) > strip ran fine on tcpdump-t4oxHH/tcpdump-4.7.4/tcpdump from [1], producing the > same binary as tcpdump-t4oxHH/tcpdump-4.7.4/debian/tcpdump/usr/sbin/tcpdump > without reporting any errors. Can you try running strip on debian/tcpdump/usr/sbin/tcpdump? From the output of Debian's dh_strip: (sid2-powerpcspe-sbuild)root@atlantis:/build/tcpdump-t4oxHH/tcpdump-4.7.4# dh_strip strip: debian/tcpdump/usr/sbin/stefyAvQ: Not enough room for program headers, try linking with -N strip:debian/tcpdump/usr/sbin/stefyAvQ[.interp]: Bad value dh_strip: strip --remove-section=.comment --remove-section=.note debian/tcpdump/usr/sbin/tcpdump returned exit code 1 (sid2-powerpcspe-sbuild)root@atlantis:/build/tcpdump-t4oxHH/tcpdump-4.7.4#
Confirmed. Running strip again on the already-stripped binary reports an error.
It's a missing "break".
(In reply to Alan Modra from comment #5) > It's a missing "break". Awesome, that was quick. Thanks a lot! When fixing it, please don't forget the backport to the 2.27 branch so it will be picked up by Debian with the next update of the binutils package.
The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8941017bc0226b60ce306d5271df15820ce66a53 commit 8941017bc0226b60ce306d5271df15820ce66a53 Author: Alan Modra <amodra@gmail.com> Date: Tue Aug 30 20:57:32 2016 +0930 ppc apuinfo for spe parsed incorrectly apuinfo saying SPE resulted in mach = bfd_mach_ppc_vle due to a missing break. PR 20531 * elf32-ppc.c (_bfd_elf_ppc_set_arch): Add missing "break".
The binutils-2_27-branch branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2a0b8eb7a7974ff7605cb3ba5dffa5abef286ffa commit 2a0b8eb7a7974ff7605cb3ba5dffa5abef286ffa Author: Alan Modra <amodra@gmail.com> Date: Tue Aug 30 20:57:32 2016 +0930 ppc apuinfo for spe parsed incorrectly apuinfo saying SPE resulted in mach = bfd_mach_ppc_vle due to a missing break. PR 20531 * elf32-ppc.c (_bfd_elf_ppc_set_arch): Add missing "break".
Fixed. Note that the output of the first strip is broken, with SHF_PPC_VLE incorrectly being added to executable sections.