public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [Patch: pe-i386] ld/deffilep.y (import_def): Use default extension 'dll'
@ 2003-03-13  8:35 Danny Smith
  2003-03-13  8:38 ` Christopher Faylor
  0 siblings, 1 reply; 3+ messages in thread
From: Danny Smith @ 2003-03-13  8:35 UTC (permalink / raw)
  To: binutils; +Cc: Luke Dunstan, Christopher Faylor

Common usage for IMPORT section definitions in def files omit the dll
module extension name eg:

IMPORTS
my_api_stdcallname@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).

Fixed so:


2003-03-13  Danny Smith  <dannysmith@users.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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Patch: pe-i386] ld/deffilep.y (import_def): Use default extension 'dll'
  2003-03-13  8:35 [Patch: pe-i386] ld/deffilep.y (import_def): Use default extension 'dll' Danny Smith
@ 2003-03-13  8:38 ` Christopher Faylor
  2003-03-13  9:47   ` Danny Smith
  0 siblings, 1 reply; 3+ messages in thread
From: Christopher Faylor @ 2003-03-13  8:38 UTC (permalink / raw)
  To: Danny Smith; +Cc: binutils, Luke Dunstan

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@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@users.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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Patch: pe-i386] ld/deffilep.y (import_def): Use default extension 'dll'
  2003-03-13  8:38 ` Christopher Faylor
@ 2003-03-13  9:47   ` Danny Smith
  0 siblings, 0 replies; 3+ messages in thread
From: Danny Smith @ 2003-03-13  9:47 UTC (permalink / raw)
  To: Christopher Faylor; +Cc: binutils, Luke Dunstan

 --- Christopher Faylor <cgf@redhat.com> wrote: > On Thu, Mar 13, 2003 at
07:35:06PM +1100, Danny Smith wrote:

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

Checked in with that modification.
Danny

> >
> >2003-03-13  Danny Smith  <dannysmith@users.sourceforge,net> 
> >
> >
> >	* deffilep.y (def_import):  Use default extension of "dll"
> >	if no extension provided in parsed IMPORT command.
> >
> >


http://mobile.yahoo.com.au - Yahoo! Mobile
- Check & compose your email via SMS on your Telstra or Vodafone mobile.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-03-13  9:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-13  8:35 [Patch: pe-i386] ld/deffilep.y (import_def): Use default extension 'dll' Danny Smith
2003-03-13  8:38 ` Christopher Faylor
2003-03-13  9:47   ` Danny Smith

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