public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro_alves@portugalmail.pt>
Cc: Binutils <binutils@sourceware.org>,
	  Danny Smith <dannysmith@clear.net.nz>,
	 Nick Clifton <nickc@redhat.com>, Christopher Faylor <me@cgf.cx>
Subject: Re: [Patch/pe-coff] : Add native spelling of import lib names to    dynamic  lib search
Date: Mon, 26 Jun 2006 12:32:00 -0000	[thread overview]
Message-ID: <449FD0D1.3050600@portugalmail.pt> (raw)
In-Reply-To: <449DF3EE.2010107@portugalmail.pt>

[-- Attachment #1: Type: text/plain, Size: 1744 bytes --]

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  <dannysmith@users.sourceforge.net>
 >>>
 >>> 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 <pedro_alves@portugalmail.pt>

	* 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


[-- Attachment #2: pe.em.diff.gz --]
[-- Type: application/gzip, Size: 1103 bytes --]

  reply	other threads:[~2006-06-26 12:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-19  9:35 Danny Smith
2006-06-22 13:52 ` Nick Clifton
2006-06-24 17:32   ` Pedro Alves
2006-06-25 13:50     ` Pedro Alves
2006-06-26 12:32       ` Pedro Alves [this message]
2006-06-27 14:57         ` Nick Clifton
2006-06-20  7:39 Ross Ridge
2006-06-20  8:51 Danny Smith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=449FD0D1.3050600@portugalmail.pt \
    --to=pedro_alves@portugalmail.pt \
    --cc=binutils@sourceware.org \
    --cc=dannysmith@clear.net.nz \
    --cc=me@cgf.cx \
    --cc=nickc@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).