[Patch]: Fw: binutils/cygwin breakage

Christopher Faylor cgf@redhat.com
Fri Feb 20 15:40:00 GMT 2004


On Sun, Feb 15, 2004 at 09:22:24PM +1100, Danny Smith wrote:
>> From: "Christopher Faylor" 
>> Sent: Sunday, 15 February 2004 03:06
>> Subject: binutils/cygwin breakage
>> 
>> 
>> Hi,
>> This change:
>> 
>> 2004-01-20  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
>>         flag has been cleared.
>> 
>> breaks cygwin's autoload facilities which create writeable text
>> sections.  With this change, it seems like cygwin's text sections
>> become read-only.
>> 
>> Reading the comment, it seems like you tried to take this behavior into
>> account but, if that is the case, it doesn't seem to be working.
>> 
>> I think cygwin's use is pretty straightforward.  It creates sections
>> like this:
>> 
>> .section .foo_text,"wx"
>> 
>> Any ideas on how to fix this?
>
>OK, my bad.   This fixes in my test.  The bug I introduced in my patch was to
>clear IMAGE_SCN_MEM_WRITE on non-standard sections as well as known ones.
>
>This puts it back in the loop through the known sections
>(where it was originally).
>
>Danny
>
>2004-02-15  Danny Smith  <daanysmith@users.sourceforge.net>
>
>	* peXXigen.c (_bfd_XXi_swap_scnhdr_out): Only clear
>	IMAGE_SCN_MEM_WRITE on known sections,	 

FWIW, I can confirm that this patch fixes my problems building cygwin with
the CVS version of binutils.

I do still have minor reservations about unilaterally removing write
permissions from any well-known text segment since it seems like this
removes some control from the user.  But your patch doesn't really change
this behavior.  It just makes it more specific.

So, if there are no reservations from any of the binutils big guns, then
I'd say this is ok to check in.

cgf



More information about the Binutils mailing list