[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/20193] Invalid executable after adding debuglink to an exe

From: nickc at redhat dot com
Subject: [Bug binutils/20193] Invalid executable after adding debuglink to an executable produced after merging PE resource sections
Date: Fri, 03 Jun 2016 10:15:10 +0000


Nick Clifton <nickc at redhat dot com> changed:

           What    |Removed                     |Added
                 CC|                            |nickc at redhat dot com

--- Comment #2 from Nick Clifton <nickc at redhat dot com> ---
Hi Jon,

  Please could upload the 1.exe, 2.exe, 3.exe and 3.dbg files ?  I do not have
  a mingw64 build system here...

  It would be really nice if Windows could tell us *why* it does not like 3.exe
  binary.  Is there a Windows tool that dumps resources and which might give a
  error message or two ?

> The size of the resources in the DataDirectory is not updated by 
>  rsrc_process_section()

  Hmm, I wonder if that is it.  Does this, completely untested, patch make a
  difference ?


diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index c92c1ea..bb0e2c8 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -4320,6 +4320,8 @@ rsrc_process_section (bfd * abfd,
   bfd_set_section_contents (pfinfo->output_bfd, sec, new_data, 0, size);
   sec->size = sec->rawsize = size;

+  pe->pe_opthdr.DataDirectory[PE_RESOURCE_TABLE].Size = size;
   /* Step six: Free all the memory that we have used.  */
   /* FIXME: Free the resource tree, if we have one.  */

You are receiving this mail because:
You are on the CC list for the bug.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]