This is the mail archive of the binutils@sources.redhat.com 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]

Re: [Patch: pe-i386] ld/deffilep.y (import_def): Use default extension 'dll'


On Thu, Mar 13, 2003 at 07:35:06PM +1100, Danny Smith wrote:
>Common usage for IMPORT section definitions in def files omit the dll
>module extension name eg:
>
>IMPORTS
>my_api_stdcallname at 8 = Vendor.PascalName
>
>where  PascalName is imported from Vendor.dll
>
>(MS  does not document this feature much, but it seems to be more widely
>used with Borland compiler. See, eg.
>http://web.bham.ac.uk/carterd/glide/define.htm) 
>
>This fails with current ld.  A default extension is not provided. Although
>a dll is created, at load time the user dll looks for but cannot
>find the module Vendor (but could find Vendor.dll).

Maybe I'm missing something but I don't think that the use of default_ext
adds much here.  I think just using "dll" in the comma operator would be
clearer.

Unless you strongly disagree, you can check this in with that minor change.

cgf

>Fixed so:
>
>
>2003-03-13  Danny Smith  <dannysmith at users dot sourceforge,net> 
>
>
>	* deffilep.y (def_import):  Use default extension of "dll"
>	if no extension provided in parsed IMPORT command.
>
>
>*** deffilep.y	Thu Mar 13 06:35:23 2003
>--- deffilep.y.new	Thu Mar 13 07:23:39 2003
>*************** def_import (internal_name, module, dllex
>*** 807,819 ****
>       int ordinal;
>  {
>    char *buf = 0;
>! 
>!   if (dllext != NULL)
>!     {
>!       buf = (char *) xmalloc (strlen (module) + strlen (dllext) + 2);
>!       sprintf (buf, "%s.%s", module, dllext);
>!       module = buf;
>!     }
>  
>    def_file_add_import (def, name, module, ordinal, internal_name);
>    if (buf)
>--- 807,818 ----
>       int ordinal;
>  {
>    char *buf = 0;
>!   const char default_ext[] = "dll";
>!   const char *ext = dllext ? dllext : default_ext;    
>!    
>!   buf = (char *) xmalloc (strlen (module) + strlen (ext) + 2);
>!   sprintf (buf, "%s.%s", module, ext);
>!   module = buf;
>  
>    def_file_add_import (def, name, module, ordinal, internal_name);
>    if (buf)
>
>http://mobile.yahoo.com.au - Yahoo! Mobile
>- Check & compose your email via SMS on your Telstra or Vodafone mobile.


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