aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2007-11-13 20:17:43 +0000
committerH.J. Lu <hjl.tools@gmail.com>2007-11-13 20:17:43 +0000
commit4be8cddcc5ee2c8d0a078cb6cc93ba225c9768a1 (patch)
tree85f12c54cd99e67c5353c74217ee70440a5f199c /bfd
parent70e654ba489ea64e5ba72c63fc56e8a2d5dfd894 (diff)
downloadgdb-4be8cddcc5ee2c8d0a078cb6cc93ba225c9768a1.zip
gdb-4be8cddcc5ee2c8d0a078cb6cc93ba225c9768a1.tar.gz
gdb-4be8cddcc5ee2c8d0a078cb6cc93ba225c9768a1.tar.bz2
2007-11-13 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/5307 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Don't copy input subsystem if output is different from input.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/peXXigen.c13
2 files changed, 17 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6a7fe8d..d9470a2 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2007-11-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/5307
+ * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Don't
+ copy input subsystem if output is different from input.
+
2007-11-13 Nick Clifton <nickc@redhat.com>
* elf-m10300.c (mn10300_elf_final_link_relocate): Prevent the
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index 2d09561..ddba235 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -1987,13 +1987,22 @@ _bfd_XX_print_private_bfd_data_common (bfd * abfd, void * vfile)
bfd_boolean
_bfd_XX_bfd_copy_private_bfd_data_common (bfd * ibfd, bfd * obfd)
{
+ pe_data_type *ipe, *ope;
+
/* One day we may try to grok other private data. */
if (ibfd->xvec->flavour != bfd_target_coff_flavour
|| obfd->xvec->flavour != bfd_target_coff_flavour)
return TRUE;
- pe_data (obfd)->pe_opthdr = pe_data (ibfd)->pe_opthdr;
- pe_data (obfd)->dll = pe_data (ibfd)->dll;
+ ipe = pe_data (ibfd);
+ ope = pe_data (obfd);
+
+ ope->pe_opthdr = ipe->pe_opthdr;
+ ope->dll = ipe->dll;
+
+ /* Don't copy input subsystem if output is different from input. */
+ if (obfd->xvec != ibfd->xvec)
+ ope->pe_opthdr.Subsystem = IMAGE_SUBSYSTEM_UNKNOWN;
/* For strip: if we removed .reloc, we'll make a real mess of things
if we don't remove this entry as well. */