This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch/pe-coff] : Add native spelling of import lib names to dynamic lib search
- From: Pedro Alves <pedro_alves at portugalmail dot pt>
- To: Binutils <binutils at sourceware dot org>
- Cc: Danny Smith <dannysmith at clear dot net dot nz>, Nick Clifton <nickc at redhat dot com>, Christopher Faylor <me at cgf dot cx>
- Date: Sun, 25 Jun 2006 03:24:46 +0100
- 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>
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.
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?