mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-03 04:12:10 +08:00
c68c163716
In objcopy, copy_object calls copy_section to copy contents of input section to output section. When --gap-fill= is used, objcopy extends the size of output sectios to fill gaps between output sections with gap fills. In this case, we adjust the output section size to skip gap files to avoid reading beypond the input section buffer before calling copy_section and restore the output section size after input sections have been copied. binutils/ PR binutils/19005 * objcopy.c (copy_object): Adjust the output section size to skip gap fills between sections when copying from input sections to output sections. ld/testsuite/ PR binutils/19005 * ld-elf/pr19005.d: New file. * ld-elf/pr19005.s: Likewise. * ld-elf/pr19005.t: Likewise.
11 lines
274 B
Makefile
11 lines
274 B
Makefile
#ld: -Tpr19005.t
|
|
#objcopy_linked_file: -O binary -j .foo -j .bar --gap-fill=0xff
|
|
#objdump: -b binary -s
|
|
|
|
#...
|
|
Contents of section .data:
|
|
0000 10ffffff ffffffff ffffffff ffffffff ................
|
|
0010 ffffffff ffffffff ffffffff ffffffff ................
|
|
0020 20.*
|
|
#pass
|