This is the mail archive of the
mailing list for the binutils project.
Re: PATCH: PR binutils/5307: objcopy PE<->EFI doesn't work when both PE/EFI are enabled
- From: Pedro Alves <pedro_alves at portugalmail dot pt>
- To: "H.J. Lu" <hjl at lucon dot org>
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 12 Nov 2007 23:02:56 +0000
- Subject: Re: PATCH: PR binutils/5307: objcopy PE<->EFI doesn't work when both PE/EFI are enabled
- References: <20071112140816.GA11405@lucon.org>
H.J. Lu wrote:
objcopy sets pe_opthdr.Subsystem in _bfd_XXi_swap_aouthdr_out if it is
IMAGE_SUBSYSTEM_UNKNOWN. But _bfd_XX_bfd_copy_private_bfd_data_common
copies pe_opthdr.Subsystem from input to output so that
pe_opthdr.Subsystem is never changed. This patch sets
pe_opthdr.Subsystem to IMAGE_SUBSYSTEM_UNKNOWN if output is different
Wouldn't you normally want the default subsystem of the
output? Isn't it IMAGE_SUBSYSTEM_EFI_APPLICATION for efi-app-* ?
Wouldn't a more general objcopy flag to change the subsystem
to the one you want be more useful (like ld's --subsystem) ?