From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10408 invoked by alias); 25 Jun 2006 02:24:57 -0000 Received: (qmail 10389 invoked from network); 25 Jun 2006 02:24:49 -0000 Received: from unknown (195.23.133.218) by sourceware.org with QMTP; 25 Jun 2006 02:24:49 -0000 Received: (qmail 27965 invoked from network); 25 Jun 2006 02:24:48 -0000 Received: from unknown (HELO mailfrt08.isp.novis.pt) ([195.23.133.200]) (envelope-sender ) by mailrly08.isp.novis.pt with compressed SMTP; 25 Jun 2006 02:24:48 -0000 Received: (qmail 5647 invoked from network); 25 Jun 2006 02:24:46 -0000 Received: from unknown (HELO mamas-laptop) ([195.23.225.213]) (envelope-sender ) by mailfrt08.isp.novis.pt with SMTP; 25 Jun 2006 02:24:46 -0000 Received: from localhost ([127.0.0.1]) by mamas-laptop with esmtp (Exim 4.62) (envelope-from ) id J1E9DC-00006W-46; Sun, 25 Jun 2006 03:24:48 +0100 Message-ID: <449DF3EE.2010107@portugalmail.pt> Date: Sun, 25 Jun 2006 13:50:00 -0000 From: Pedro Alves User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: Binutils CC: Danny Smith , Nick Clifton , Christopher Faylor Subject: Re: [Patch/pe-coff] : Add native spelling of import lib names to dynamic lib search References: <000401c6933b$4e261530$984861cb@anykey> <449A9F15.500@redhat.com> <449D37EB.3030407@portugalmail.pt> In-Reply-To: <449D37EB.3030407@portugalmail.pt> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 0625-7, 23-06-2006), Outbound message X-Antivirus-Status: Clean X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2006-06/txt/msg00377.txt.bz2 Pedro Alves wrote: > Nick Clifton wrote: >>> >>> * emultempl/pe.em (gld_${EMULATION_NAME}_open_dynamic_archive): >>> Restructure. Add native "%s.lib" format to search list >>> * ld.texinfo (node WIN32): Update documentation on dynamic lib >>> search order. Add another reason for using import libs. >> 2006-06-19 Danny Smith >> >> Approved and applied. >> >> Note - I slightly changed the construction of the size passed to the >> xmalloc() function, so that instead of using sizeof on a separate >> string, it accesses the libname_fmt structure and pulls a string out >> of there. I felt that this made it more obvious as to why the value >> was being included in the computation of the amount of memory >> required. I also added a comment into the declaration of the >> libname_fmt structure to remind future coders to check and update the >> length if necessary. > This doesn't work correctly. The sizeof (libname_fmt.format) is sizeof > (const char*), not the sizeof the string. > > Fixed with the following patch. Other possibilities would be to > s/sizeof/strlen/ or sizeof(*libname_fmt.format), > by I think this way makes the code clearer, and less surprising. > To be clear: Where I said "Fixed", I meant "This patch is a proposed fix". Cheers, Pedro Alves P.S. Is the mailing list having problems, or is it just me?