This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[Patch]: Fw: binutils/cygwin breakage
- From: Danny Smith <danny_r_smith_2001 at yahoo dot co dot nz>
- To: binutils <binutils at sources dot redhat dot com>, Christopher Faylor <cgf at redhat dot com>
- Date: Sun, 15 Feb 2004 21:22:24 +1100 (EST)
- Subject: [Patch]: Fw: binutils/cygwin breakage
> 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,
Index: peXXigen.c
===================================================================
RCS file: /cvs/src/src/bfd/peXXigen.c,v
retrieving revision 1.21
diff -c -3 -p -r1.21 peXXigen.c
*** peXXigen.c 20 Jan 2004 21:04:19 -0000 1.21
--- peXXigen.c 15 Feb 2004 10:05:18 -0000
*************** _bfd_XXi_swap_scnhdr_out (abfd, in, out)
*** 992,1005 ****
default WP_TEXT file flag has been cleared. WP_TEXT may be cleared
by ld --enable-auto-import (if auto-import is actually needed),
by ld --omagic, or by obcopy --writable-text. */
-
- if (strcmp (scnhdr_int->s_name, ".text")
- || (bfd_get_file_flags (abfd) & WP_TEXT))
- flags &= ~IMAGE_SCN_MEM_WRITE;
for (p = known_sections; p->section_name; p++)
if (strcmp (scnhdr_int->s_name, p->section_name) == 0)
{
flags |= p->must_have;
break;
}
--- 992,1004 ----
default WP_TEXT file flag has been cleared. WP_TEXT may be cleared
by ld --enable-auto-import (if auto-import is actually needed),
by ld --omagic, or by obcopy --writable-text. */
for (p = known_sections; p->section_name; p++)
if (strcmp (scnhdr_int->s_name, p->section_name) == 0)
{
+ if (strcmp (scnhdr_int->s_name, ".text")
+ || (bfd_get_file_flags (abfd) & WP_TEXT))
+ flags &= ~IMAGE_SCN_MEM_WRITE;
flags |= p->must_have;
break;
}
> cgf
>
Try the new improved Yahoo! Australia & NZ Search at http://www.yahoo.com.au