[roger@metaphorics.com: [Patch] Fix section flags for pe-i386]
Christopher Faylor
cgf@redhat.com
Fri Apr 13 15:38:00 GMT 2001
On Fri, Apr 13, 2001 at 06:33:11PM -0400, DJ Delorie wrote:
>Any comments?
Sounds good to me. I'd love to get rid of those warnings.
If you apply the patch, I could make a new binutils release just to
see if there are any complaints from the user community.
cgf
>------- Start of forwarded message -------
>Mailing-List: contact binutils-help@sourceware.cygnus.com; run by ezmlm
>Precedence: bulk
>List-Unsubscribe: < mailto:binutils-unsubscribe-dj-ml=delorie.com@sources.redhat.com >
>List-Subscribe: < mailto:binutils-subscribe@sources.redhat.com >
>List-Archive: < http://sources.redhat.com/ml/binutils/ >
>List-Post: < mailto:binutils@sources.redhat.com >
>List-Help: < mailto:binutils-help@sources.redhat.com >, < http://sources.redhat.com/ml/#faqs >
>Sender: binutils-owner@sources.redhat.com
>Date: Fri, 13 Apr 2001 15:22:39 -0600 (MDT)
>From: Roger Sayle <roger@metaphorics.com>
>X-Sender: roger@daylight.daylight.com
>To: binutils@sources.redhat.com
>Subject: [Patch] Fix section flags for pe-i386
>Content-Type: TEXT/PLAIN; charset=US-ASCII
>
>
>The bfd library currently thinks that the SEC_READONLY section flag is
>not applicable to pe-i386 coff files, such as those used by cygwin. This
>means that objects files created by binutils never have the READONLY flag
>set for ".text" sections. This causes the Microsoft linker, LINK.EXE,
>to issue warnings when linking cygwin object files and libraries with
>native object files and libraries.
>
>Warning LNK4078: multiple ".text" sections found with different
>attributes.
>
>The "obvious" patch is to allow SEC_READONLY section flag to be used on
>pe-i386 and pei-i386 targets. This cures the warnings, and has been
>tested on i586-pc-cygwin and i686-pc-cygwin with MSVC 5.0 and 6.0.
>
>Just in case this flag actually affected behaviour, I also tested with
>bootstraps of binutils and gcc, and built several local applications
>and DLLs, both with and without the "-mno-cygwin" flag, on Windows95
>and Windows ME. There were no regressions in several days of testing.
>
>A one line bug fix shouldn't require a copyright assigment.
>
>
>
>2001-04-13 Roger Sayle <roger@metaphorics.com>
>
> * coff-i386.c (TARGET_SYM): SEC_READONLY is an applicable
> section flag on pe-i386 targets.
>
>
>
>*** bfd/coff-i386.c.orig Fri Apr 13 14:58:49 2001
>- --- bfd/coff-i386.c Fri Apr 13 14:59:16 2001
>***************
>*** 1,6 ****
> /* BFD back-end for Intel 386 COFF files.
> Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
>! 2000
> Free Software Foundation, Inc.
> Written by Cygnus Support.
>
>- --- 1,6 ----
> /* BFD back-end for Intel 386 COFF files.
> Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
>! 2000, 2001
> Free Software Foundation, Inc.
> Written by Cygnus Support.
>
>***************
>*** 576,582 ****
>
> (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */
> #ifdef COFF_WITH_PE
>! | SEC_LINK_ONCE | SEC_LINK_DUPLICATES
> #endif
> | SEC_CODE | SEC_DATA),
>
>- --- 576,582 ----
>
> (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */
> #ifdef COFF_WITH_PE
>! | SEC_LINK_ONCE | SEC_LINK_DUPLICATES | SEC_READONLY
> #endif
> | SEC_CODE | SEC_DATA),
>
>
>
>Roger
>- --
>Roger Sayle, E-mail: roger@metaphorics.com
>Bioinformatics Group, Metaphorics, WWW: http://www.metaphorics.com/
>Office 104, 441 Greg Avenue, Tel: (+1) 505-954-3281
>Santa Fe, New Mexico, 87501. Fax: (+1) 505-989-1200
>------- End of forwarded message -------
--
cgf@cygnus.com Red Hat, Inc.
http://sources.redhat.com/ http://www.redhat.com/
More information about the Cygwin-apps
mailing list