From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24619 invoked by alias); 26 Jun 2006 12:19:57 -0000 Received: (qmail 24595 invoked from network); 26 Jun 2006 12:19:48 -0000 Received: from unknown (195.23.133.211) by sourceware.org with QMTP; 26 Jun 2006 12:19:48 -0000 Received: (qmail 15281 invoked from network); 26 Jun 2006 12:19:47 -0000 Received: from unknown (HELO mailfrt09.isp.novis.pt) ([195.23.133.201]) (envelope-sender ) by mailrly01.isp.novis.pt with compressed SMTP; 26 Jun 2006 12:19:47 -0000 Received: (qmail 20779 invoked from network); 26 Jun 2006 12:19:40 -0000 Received: from unknown (HELO mamas-laptop) ([195.23.225.253]) (envelope-sender ) by mailfrt09.isp.novis.pt with SMTP; 26 Jun 2006 12:19:40 -0000 Received: from localhost ([127.0.0.1]) by mamas-laptop with esmtp (Exim 4.62) (envelope-from ) id J1GVKI-0001VO-AE; Mon, 26 Jun 2006 13:19:30 +0100 Message-ID: <449FD0D1.3050600@portugalmail.pt> Date: Mon, 26 Jun 2006 12:32:00 -0000 From: Pedro Alves User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 CC: Binutils , 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> <449DF3EE.2010107@portugalmail.pt> In-Reply-To: <449DF3EE.2010107@portugalmail.pt> Content-Type: multipart/mixed; boundary="------------040709000202090004060604" 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/msg00383.txt.bz2 This is a multi-part message in MIME format. --------------040709000202090004060604 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1744 Pedro Alves wrote: > 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. >> Sorry for generating a lot of noise, but it seems the patch got mangled up, because I accidently posted as html. Here goes the same patch an an attached gzip. 2006-06-24 Pedro Alves * emultempl/pe.em (gld_${EMULATION_NAME}_open_dynamic_archive): New member fixed_len in libname_fmt, representing the length of the format string minus the length of the formatters. Adjust xmalloc call to use the longest of the lengths. Cheers, Pedro Alves --------------040709000202090004060604 Content-Type: application/gzip; name="pe.em.diff.gz" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="pe.em.diff.gz" Content-length: 1497 H4sICFzOn0QCA3BlLmVtLmRpZmYAlVZdb9pIFH2GX3GX7ioQY2JYQrekTYu0 iVSJplGbaB+qyhrsMYwy2JY9bkKj/Pee8djGEBN1ERJm7teZc8/csW3bFPMB Xw+iZNkaOc7Exnc0puHf0+E/09Fo4JQfspyh47QtyzIRe96n4+lw8sz7wwey h5M3r/unI7Lyh4lDWFxK3/3z8eLT7Xx28/HzlXs1+3Tx5EYxD11/E7K18FyW eCvRJqJUMSU88qIwVfiTZJ7Sy0SP5ocKk7diCR1TECVrps7alrGJUFEgHrjv Sh6elRGLwHcXUS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lfovOIv1vsFkrXOy12znp9MimYfMFZny7MXd9rbI8V/Ey Zoz4vK/k1OTWo6k+ub8AqvvZockKAAA= --------------040709000202090004060604--