This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Hello, 

Current ld is able to handle the short import lib format (ILF)
used by windows32 native compiler. This means that mingw32 and cygwin
projects can link against system dlls using the import libs provided by
the  OS vendor (ie, the platform software and driver development kits
distributed by MS).

However, the native naming convention for these import libs is "foo.lib"
and gld_i386pe_open_dynamic_archive does not currently recognize this
name format. This means that doing something like -L/path/to/sdk -lfoo32
could link directly to "foo32.dll", rather than find the import lib
"foo32.lib". In the case of windows systems libs, this direct linking to
dll does _not_ work because of aliasing of the names in the symbol
export table. An import lib is necessary and the developer has to either
rename foo.lib to lib.foo.a or forego the -L/path/to/sdk -lfoo32 -lbar32
syntax and specify the full pathname of each import lib on the command
line. Recognition of "foo.lib" as an import lib would also mean that the
testing of dll's that are intended to work with native as well as GNU
development tools could bypass the current necessity of copying
lib.foo.a to foo.lib, 

The attached patch adds this feature. I have also added a note on symbol
aliasing and import libs to ld.texinfo.


ChangeLog

2006-06-19  Danny Smith  <dannysmith@users.sourceforge.net>

	* 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.	

Attachment: open_dynamic.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]