[binutils-gdb] Skip discarded resource sections when building a PE resource table.

Nick Clifton nickc@sourceware.org
Wed May 6 13:19:00 GMT 2015


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9ac47a43ffc8e3c73867b9953145a8e7a227132d

commit 9ac47a43ffc8e3c73867b9953145a8e7a227132d
Author: Toni Spets <toni.spets@iki.fi>
Date:   Wed May 6 14:18:34 2015 +0100

    Skip discarded resource sections when building a PE resource table.
    
    	PR ld/18372
    	* peXXigen.c (rsrc_process_section): Skip discarded resource
    	sections.

Diff:
---
 bfd/ChangeLog  | 6 ++++++
 bfd/peXXigen.c | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 034d34d..000cd71 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2015-05-06  Toni Spets  <toni.spets@iki.fi>
+
+	PR ld/18372
+	* peXXigen.c (rsrc_process_section): Skip discarded resource
+	sections.
+
 2015-05-01  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* config.bfd: Support i[3-7]86-*-elf*.
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index 6aa18ca..c897c64 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -4160,7 +4160,8 @@ rsrc_process_section (bfd * abfd,
     {
       asection * rsrc_sec = bfd_get_section_by_name (input, ".rsrc");
 
-      if (rsrc_sec != NULL)
+      /* PR 18372 - skip discarded .rsrc sections.  */
+      if (rsrc_sec != NULL && !discarded_section (rsrc_sec))
 	{
 	  if (num_input_rsrc == max_num_input_rsrc)
 	    {



More information about the Binutils-cvs mailing list