bfd/
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 27 Apr 2009 13:59:43 +0000 (13:59 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 27 Apr 2009 13:59:43 +0000 (13:59 +0000)
2009-04-27  H.J. Lu  <hongjiu.lu@intel.com>

* peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Don't
copy pe_opthdr.

binutils/

2009-04-27  H.J. Lu  <hongjiu.lu@intel.com>

* objcopy.c (copy_object): Copy pe_opthdr before changing PE
parameters.

bfd/ChangeLog
bfd/peXXigen.c
binutils/ChangeLog
binutils/objcopy.c

index bc34a78f71147dabd9301209f40e0221a6cfd074..194ba68afe06eac83efc07770dbbf8b55ea12917 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-27  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Don't
+       copy pe_opthdr.
+
 2009-04-23  Matthias Klose  <doko@ubuntu.com>
 
        * peXXigen.c (_bfd_XXi_swap_sym_in): Initialize `name'.
index 76224cb090601d22730268df99a38d92d50ed3f9..4229de2e6592af2ed1567da7797ec0abeec636ac 100644 (file)
@@ -2188,7 +2188,7 @@ _bfd_XX_bfd_copy_private_bfd_data_common (bfd * ibfd, bfd * obfd)
   ipe = pe_data (ibfd);
   ope = pe_data (obfd);
  
-  ope->pe_opthdr = ipe->pe_opthdr;
+  /* pe_opthdr is copied in copy_object.  */
   ope->dll = ipe->dll;
 
   /* Don't copy input subsystem if output is different from input.  */
index 0e2d554d5c67edec953eb47bd9fbcb72b0848d43..75af8f190028396501649013424dfe4f374a4ca5 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-27  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * objcopy.c (copy_object): Copy pe_opthdr before changing PE
+       parameters.
+
 2009-04-24  Cary Coutant  <ccoutant@google.com>
 
        * dwarf.c (process_extended_line_op): Add DW_LNE_set_discriminator.
index 3fe874114db5465c63b13d08b899f79f6c848231..7ef95c52c16c34919f180891b5def0b31279abc8 100644 (file)
@@ -1491,6 +1491,11 @@ copy_object (bfd *ibfd, bfd *obfd)
       /* Set up PE parameters.  */
       pe_data_type *pe = pe_data (obfd);
 
+      /* Copy PE parameters before changing them.  */
+      if (ibfd->xvec->flavour == bfd_target_coff_flavour
+         && bfd_pei_p (ibfd))
+       pe->pe_opthdr = pe_data (ibfd)->pe_opthdr;
+
       if (pe_file_alignment != (bfd_vma) -1)
        pe->pe_opthdr.FileAlignment = pe_file_alignment;
       else