Fix PE/COFF resource merging problems. There were two issues:
authorNick Clifton <nickc@redhat.com>
Thu, 24 Apr 2014 10:15:43 +0000 (11:15 +0100)
committerNick Clifton <nickc@redhat.com>
Thu, 24 Apr 2014 10:15:43 +0000 (11:15 +0100)
commit3714081cb37fc60f3262b4c64e81539eb4f3592f
treee37b6d8173cc89d089cddb5fa6f690c5a9fc0418
parent2a87f7b84f1a3d101a19d7008802172ff50596e5
Fix PE/COFF resource merging problems.  There were two issues:

  1. Strings (and then resource data) must follow immediately after
     the end of the tables.
  2. Units of resource data must be 8-byte aligned.

PR ld/16807
* peXXigen.c (struct rsrc_regions): New structure.
(rsrc_print_resource_directory): Use new structure.  Include
offset of directory in listing.
(rsrc_print_resource_entry): Likewise.
(rsrc_print_section): Likewise.
(rsrc_count_entries): Do not increment sizeof_strings or
sizeof_leaves.
(rsrc_count_directory): Do not increment sizeof_tables.
(rsrc_compute_region_sizes): New function.
(rsrc_write_leaf): Maintain 8-byte alignment for resource data.
(rsrc_process_section): Compute size of regions after merging
entries.
bfd/ChangeLog
bfd/peXXigen.c