[Patch] Fix PE dll -auto-import breakage from enforcing PE specs for section flags

Nick Clifton nickc@redhat.com
Tue Jan 20 09:41:00 GMT 2004

Hi Danny,

> bfd/ChangeLog
> 2003-01-16  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-16  Danny Smith  <dannysmith@users.sourceforge.net>
> 	* pe-dll.c (pe_create_import_fixup): Unset WP_TEXT.
> 	* ld.texinfo (--omagic): Note that writable text section
> 	does not conform to published PE-COFF specs.
> 	(--enable-auto-import): Likewise.

Approved, please apply.

But ...

> +     /* We have defaulted to adding the IMAGE_SCN_MEM_WRITE flag, but now
> +        we know exactly what this specific section wants so we remove it
> +        and then allow the must_have field to add it back in if necessary.
> +        However, we don't remove IMAGE_SCN_MEM_WRITE flag from .text if the
> +        default WP_TEXT file flag has been unset. */

Comment formatting - two spaces after full stop.  Plus I would suggest
adding a sentence that explains that WP_TEXT can be set for example
when auto-import is active.


More information about the Binutils mailing list