+2015-09-29 H.J. Lu <hongjiu.lu@intel.com>
+
+ 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.
+
2015-09-28 Nick Clifton <nickc@redhat.com>
* po/fr.po: Updated French translation.
void *dhandle;
enum bfd_architecture iarch;
unsigned int imach;
+ unsigned int c, i;
if (ibfd->xvec->byteorder != obfd->xvec->byteorder
&& ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN
}
}
- if (bfd_count_sections (obfd) != 0
+ c = bfd_count_sections (obfd);
+ if (c != 0
&& (gap_fill_set || pad_to_set))
{
asection **set;
- unsigned int c, i;
/* We must fill in gaps between the sections and/or we must pad
the last section to a specified address. We do this by
increasing the section sizes as required to fill the gaps.
We write out the gap contents below. */
- c = bfd_count_sections (obfd);
osections = (asection **) xmalloc (c * sizeof (asection *));
set = osections;
bfd_map_over_sections (obfd, get_sections, &set);
bfd_map_over_sections (ibfd, copy_relocations_in_section, obfd);
/* This has to happen after the symbol table has been set. */
+ if (gap_fill_set)
+ {
+ /* Adjust the output section size to skip gap fills between
+ sections. */
+ c = bfd_count_sections (obfd);
+ for (i = 0; i < c; i++)
+ if (gaps[i] != 0)
+ osections[i]->size -= gaps[i];
+ }
bfd_map_over_sections (ibfd, copy_section, obfd);
+ if (gap_fill_set)
+ {
+ /* Restore the output section size for gap fills between
+ sections. */
+ for (i = 0; i < c; i++)
+ if (gaps[i] != 0)
+ osections[i]->size += gaps[i];
+ }
if (add_sections != NULL)
{
if (gap_fill_set || pad_to_set)
{
bfd_byte *buf;
- int c, i;
/* Fill in the gaps. */
if (max_gap > 8192)
+2015-09-29 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/19005
+ * ld-elf/pr19005.d: New file.
+ * ld-elf/pr19005.s: Likewise.
+ * ld-elf/pr19005.t: Likewise.
+
2015-08-11 Peter Zotov <whitequark@whitequark.org>
PR ld/18759
--- /dev/null
+ .section .foo,"ax",%progbits
+ .globl _start
+ .type _start, %function
+_start:
+ .byte 0x10
+ .section .bar,"ax",%progbits
+ .globl aligned
+ .type aligned, %function
+ .p2align 5
+aligned:
+ .byte 0x20