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: "H.J. Lu" <hjl at lucon dot org>
- To: Pedro Alves <pedro_alves at portugalmail dot pt>
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 12 Nov 2007 15:33:02 -0800
- Subject: Re: PATCH: PR binutils/5307: objcopy PE<->EFI doesn't work when both PE/EFI are enabled
- References: <20071112140816.GA11405@lucon.org> <4738DBA0.firstname.lastname@example.org>
On Mon, Nov 12, 2007 at 11:02:56PM +0000, Pedro Alves wrote:
> 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
> >from input.
> Wouldn't you normally want the default subsystem of the
> output? Isn't it IMAGE_SUBSYSTEM_EFI_APPLICATION for efi-app-* ?
It is done with
if (extra->Subsystem == IMAGE_SUBSYSTEM_UNKNOWN)
extra->Subsystem = pe->target_subsystem;
in _bfd_XXi_swap_aouthdr_out. target_subsystem has been set properly
according to target.
> Wouldn't a more general objcopy flag to change the subsystem
> to the one you want be more useful (like ld's --subsystem) ?
It is called "-O efi-app-ia32" for objcopy.