Browse Source
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.users/ARM/embedded-binutils-2_26-branch
11 changed files with 68 additions and 32 deletions
@ -0,0 +1 @@ |
|||
abcdefgh |
|||
@ -0,0 +1,9 @@ |
|||
#PROG: objcopy |
|||
#source: pr19020.in |
|||
#as: binary |
|||
#objcopy: -O binary -I binary --pad-to=10 --gap-fill=65 --interleave=2 --interleave-width=1 --byte=0 |
|||
#objdump: -b binary -s |
|||
|
|||
#... |
|||
Contents of section .data: |
|||
0000 61636567 41414141 4141 +acegAAAAAA + |
|||
@ -0,0 +1,9 @@ |
|||
#PROG: objcopy |
|||
#source: pr19020.in |
|||
#as: binary |
|||
#objcopy: -O binary -I binary --pad-to=10 --gap-fill=65 --reverse-bytes=8 |
|||
#objdump: -b binary -s |
|||
|
|||
#... |
|||
Contents of section .data: |
|||
0000 68676665 64636261 4141 +hgfedcbaAA + |
|||
Loading…
Reference in new issue