From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26168 invoked by alias); 5 May 2004 15:57:00 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 26142 invoked from network); 5 May 2004 15:56:58 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 5 May 2004 15:56:58 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i45FuvkI001118 for ; Wed, 5 May 2004 11:56:57 -0400 Received: from localhost.redhat.com (to-dhcp51.toronto.redhat.com [172.16.14.151]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i45Fuuv10437; Wed, 5 May 2004 11:56:57 -0400 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 03D982B9D; Wed, 5 May 2004 11:56:57 -0400 (EDT) Message-ID: <40990EC8.9080304@gnu.org> Date: Wed, 05 May 2004 15:57:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-GB; rv:1.4.1) Gecko/20040217 MIME-Version: 1.0 To: Danny Smith , dk@artimi.com Cc: binutils@sources.redhat.com Subject: Re: Cygwin tester? Was: [rfa] Add bfd-in-memory io vector References: <000901c43096$b554fcd0$6e6d65da@DANNY> <000701c431c7$eb3db800$2a6d65da@DANNY> In-Reply-To: <000701c431c7$eb3db800$2a6d65da@DANNY> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-05/txt/msg00104.txt.bz2 Dave, Danny, thanks! > From: "Danny Smith" > | > | From: "Danny Smith" > | > | | > | | | > On Sat, May 01, 2004 at 02:10:31PM -0400, Andrew Cagney wrote: > | | | > > | | | >>> The testing comment still applies though. > | | | > > | | | > > | | | > Given DJ's comment, I think you should test this on cygwin before > | | | > committing. If you can't do this yourself, convince someone else > | | | > to do so for you. OK to commit once you've done this. > | | | > > > Hi, > > Although the patchset works fine (if I add the checks for HAVE_GET[GU]ID) > when building .exe files on pe targets, it fails when building dll's > (segfault in bfd/bfdio.c:bfd_bread when forwarding args to iovec->bread) I'll add this to the patch. > With binutils built with CFLAGS="-g -O2", gcc-3.4.0, mingw32: > > cat > foo.c > int foo = 1; > ^Z > gcc -shared -ofoo.dll foo.c > > raises the segfault in bfd_bread. > > Actually, the above testcase fails since your 21-April patch. > > The problem occurs when pe-dll.c code calls bread with a NULL file, asking for zero bytes > (see comment in cache.c:cache_bread). > > The problem can be avoided by doing the cache_bread FIXME in bfd_bread, ie: > > *** bfdio.c.cagney Mon May 03 10:02:13 2004 > --- bfdio.c Tue May 04 11:26:40 2004 > *************** bfd_bread (void *ptr, bfd_size_type size > *** 104,109 **** > --- 104,113 ---- > { > size_t nread; > > + /* See FIXME in cache.c:cache_bread(). */ > + if (size == 0) > + return 0; > + > nread = abfd->iovec->bread (abfd, ptr, size); > if (nread != (size_t) -1) > abfd->where += nread; Outch, thanks. I think I'll move the fixme as well as a separate patch. > With above patch, simple dll build is okay. > But this looks a bit strange in peicode.h:pe_ILF_build_a_bfd() > > + vars.bim = _bfd_in_memory (abfd, abfd->flags, vars.bim->buffer, > + vars.bim->size); Oops, yes. Andrew > Should that be: > > vars.bim = _bfd_in_memory (abfd, abfd->flags, bim.buffer, bim.size); > > > Danny