The recent fix for pr binutils/19005 broke the interleave feature. Before the "fix": $ echo -n abcdefgh > in $ objcopy -I binary -O binary \ --pad-to=10 --gap-fill=65 \ --interleave=2 --interleave-width=1 --byte=0 \ in out $ xxd out 0000000: 6163 6567 4141 4141 4141 acegAAAAAA After@ $ objcopy -I binary -O binary \ --pad-to=10 --gap-fill=65 \ --interleave=2 --interleave-width=1 --byte=0 \ in out $ xxd out 0000000: 6163 0000 4141 4141 4141 ac..AAAAAA ^^^^ ^^
Do you use --reverse-bytes? There are no testcase for --reverse-bytes with --pad-to=.
My patch in PR19005 has a testcase for --reverse-bytes, but that test passes.
(In reply to Andrew Stubbs from comment #2) > My patch in PR19005 has a testcase for --reverse-bytes, but that test passes. Does your testcase for --reverse-bytes generate output? I am looking for a testcase of --reverse-bytes --pad-to=XXX which generate an output.
It generates an output file, the same as the interleave test does: $ echo -n abcdefgh > in $ objcopy -I binary -O binary \ --pad-to=10 --gap-fill=65 \ --reverse-bytes=8 \ in out $ xxd out 0000000: 6867 6665 6463 6261 4141 hgfedcbaAA
Created attachment 8644 [details] A patch Please try this.
A patch is posted at https://sourceware.org/ml/binutils/2015-09/msg00314.html Please give it a try.
The master branch has been updated by H.J. Lu <hjl@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cbd44e247ede49688e1e1fa42e57d390ad141967 commit cbd44e247ede49688e1e1fa42e57d390ad141967 Author: H.J. Lu <hjl.tools@gmail.com> Date: Tue Sep 29 09:35:47 2015 -0700 Don't use the output section size to copy input section We can't use the output section size to copy input section since --interleave will shrink the output section. Instead, we change bfd_convert_section_contents to return the updated input section size. When we do that, we don't need to adjust the output section size to skip gap fills. bfd/ PR binutils/19020 * bfd.c (bfd_convert_section_contents): Add ptr_size parameter. * bfd-in2.h: Regenerated. binutils/ PR binutils/19020 * objcopy.c (copy_object): Don't adjust the output section size when copying from input sections. (copy_section): Use input section size for the copy. Get the updated section size from bfd_convert_section_contents. binutils/testsuite/ PR binutils/19020 * binutils-all/objcopy.exp: Run pr19020a and pr19020b. * lib/utils-lib.exp (run_dump_test): Support binary input. * binutils-all/pr19020.in: New file. * binutils-all/pr19020a.d: Likewise. * binutils-all/pr19020b.d: Likewise.
Fixed.
The test cases added for this PR are failing in remote-host testing because the piece added to run_dump_test is only copying the file locally and not downloading it to the remote host. So the tests end up running objcopy on whatever $tempfile was left over on the remote host from the previous test, instead of the intended file.
(In reply to sandra from comment #9) > The test cases added for this PR are failing in remote-host testing because > the piece added to run_dump_test is only copying the file locally and not > downloading it to the remote host. So the tests end up running objcopy on > whatever $tempfile was left over on the remote host from the previous test, > instead of the intended file. Can you provide a patch?
The master branch has been updated by Luis Machado <luisgpm@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e913b9cb939c45ce9cbf0f224da6466cd3094c3a commit e913b9cb939c45ce9cbf0f224da6466cd3094c3a Author: Luis Machado <lgustavo@codesourcery.com> Date: Fri Oct 14 09:04:46 2016 -0500 Fix leftover remote test failures from PR binutils/19020 As pointed out in PR binutils/19020, those tests were still failing when doing remote testing. This is because the binary files weren't being copied over to the remote host for testing. FAIL: binutils-all/pr19020a FAIL: binutils-all/pr19020b This small patch fixes this up to make things pass. binutils/ChangeLog: 2016-10-14 Luis Machado <lgustavo@codesourcery.com> * testsuite/lib/utils-lib.exp (run_dump_test): Call remote_download to copy file to remote host.