[Patch/pe-coff] : Add native spelling of import lib names to dynamic lib search

Pedro Alves pedro_alves@portugalmail.pt
Mon Jun 26 12:32:00 GMT 2006


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pe.em.diff.gz
Type: application/gzip
Size: 1103 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20060626/04b4c0d5/attachment.gz>


More information about the Binutils mailing list