bfd/ 2009-04-24 H.J. Lu * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Don't copy pe_opthdr. binutils/ 2009-04-24 H.J. Lu * objcopy.c (copy_object): Copy pe_opthdr before changing PE parameters. Index: binutils/objcopy.c =================================================================== --- binutils/objcopy.c (revision 5816) +++ binutils/objcopy.c (working copy) @@ -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 Index: bfd/peXXigen.c =================================================================== --- bfd/peXXigen.c (revision 5816) +++ bfd/peXXigen.c (working copy) @@ -2188,7 +2188,7 @@ _bfd_XX_bfd_copy_private_bfd_data_common 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. */