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

Nick Clifton nickc@redhat.com
Wed Jan 14 08:26:00 GMT 2004

Hi Ralf,

>>   + #ifdef STRICT_PE_FORMAT
>>     	{ ".text" , IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_CODE |
>>   +     /* When using -auto-import, .text is made writable!
>>   + 	   See ld/pe-dll.c (pe_create_import_fixup).  */
>>     	{ ".text" ,                      IMAGE_SCN_CNT_CODE |
>> IMAGE_SCN_MEM_EXECUTE }, + #endif
>> Also, it seems to me that this change (either version) will defeat the
>> purpose of the Dmitry's original patch, which was to make a PE
>> targeted toolchains output conform to Microsoft's PE spec.  (Since
>> STRICT_PE_FORMAT is only defined for one, slightly obscure, target).
>> If we do have a run-time switch, then yes, I think that the code
>> should be similarly protected.
> If this is such an obscure target, makes it really sense to add a runtime 
> switch ? 

The target that defines STRICT_PE_FORMAT is obscure: i[3-7]86-*-interix*
or at least it is not one that I have come across before.  But Danny's
patch was designed to help with the -auto-import feature which is used
by lots of (PE based) ports.  Hence adding a runtime switch to relax
the adherence to the PE standard if -auto-import is going to be used
does make sense.


More information about the Binutils mailing list