This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [Patch] Fix PE dll -auto-import breakage from enforcing PEspecs for section flags
- From: Nick Clifton <nickc at redhat dot com>
- To: Danny Smith <danny_r_smith_2001 at yahoo dot co dot nz>
- Cc: binutils <binutils at sources dot redhat dot com>
- Date: Thu, 15 Jan 2004 09:38:11 +0000
- Subject: Re: [Patch] Fix PE dll -auto-import breakage from enforcing PEspecs for section flags
- References: <20040114124520.52772.qmail@web60808.mail.yahoo.com>
Hi Danny,
> '--enable-auto-import' isn't the only problem with enforcing a readonly
> .text section. ld --omagic also break strict PE section flag specs by
> setting IMAGE_SCN_MEM_WRITE flag on .text.
>
> (objcopy --writable-text would also do the same, but it doesn't appear to
> apply to PE target).
>
> What about using WP_TEXT file flag (set by default) as a runtime flag?
> ld --omagic already unsets this flag. Make --enable-auto-import do the
> same when it is actually exercised.
Yeah that is a good idea. I like the patch too.
> As I post, I realize that ld.texi probably needs to include warnings
> that the use of --enable-auto-import or --omagic will break strict PE specs.
> I'll add those, once this is sorted.
OK, please do that as well.
> bfd/ChangeLog
>
> 2003-01-14 Danny Smith <dannysmith@users.sourceforge.net>
>
> * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Don't remove
> IMAGE_SCN_MEM_WRITE flag from .text section if WP_TEXT
> has been unset.
>
> 1d/ChangeLog
>
> 2003-01-14 Danny Smith <dannysmith@users.sourceforge.net>
>
> * pe-dll.c (pe_create_import_fixup): Unset WP_TEXT.
Approved.
Cheers
Nick