This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Commit: Add support for merging PE/COFF .rsrc sections


Hi Guys,

  I am applying the patch below to add support for merging the contents
  of .rsrc sections to PE/COFF targets.  Unfortunately the specification
  for the contents of a .rsrc section means that multiple sections
  cannot just be concatenated when linking - they have to be manipulated
  and merged together properly.

  Tested with x86_64-pc-cygwin and i686-pc-cygwin toolchains.

Cheers
  Nick

bfd/ChangeLog
2013-12-17  Nick Clifton  <nickc@redhat.com>

	* peXXigen.c: Include wchar.h if available.
	Include safe-ctype.h.
	(HighBitSet, SetHighBit, WithoutHighBit): New macros.
	(pe_print_resource_entries): Rename to
	rsrc_print_resource_entries.  Handle names that are not RVAs.
	(pe_print_resource_directory): Rename to
	rsrc_print_resource_directory.
	(pe_print_rsrc): Rename to rsrc_print_section.  Corrupt
	computation of RVA bias.
	(rsrc_count_entries): New function.
	(rsrc_count_directory): New function.
	(rsrc_parse_entry): New function.
	(rsrc_parse_entries): New function.
	(rsrc_parse_directory): New function.
	(rsrc_write_string): New function.
	(rsrc_compute_rva): New function.
	(rsrc_write_leaf): New function.
	(rsrc_write_entry): New function.
	(rsrc_write_directory): New function.
	(u16_mbtouc): New function.
	(rsrc_cmp): New function.
	(rsrc_print_name): New function.
	(rsrc_resource_name): New function.
	(rsrc_merge_string_entries): New function.
	(rsrc_sort_entries): New function.
	(rsrc_attach_chain): New function.
	(rsrc_merge): New function.
	(rsrc_process_section): New function - merges the contents of a
	.rsrc section.
	(_bfd_XXi_final_link_postscript): Call rsrc_process_section.
	* configure.in (AC_CHECK_HEADERS): Add wchar.h
	* config.in: Regenerate.
	* configure: Regenerate.

Attachment: peXXigen.c.patch.xz
Description: application/xz


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]