public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Support forward exports in .def files
@ 2005-03-11 14:26 Filip Navara
  2005-03-24 22:42 ` Christopher Faylor
  2006-01-25  8:31 ` Danny Smith
  0 siblings, 2 replies; 9+ messages in thread
From: Filip Navara @ 2005-03-11 14:26 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 273 bytes --]

Changelog:

2005-03-11  Filip Navara  <navaraf@reactos.com>

    * ld/deffile.h, ld/pe-dll.c: Add support for forward exports
    in .def files passed directly to 'ld'.
    * ld/pe-dll.c (process_def_file): Don't crash on malformed
    fastcall symbol names in .def file.


[-- Attachment #2: ld-def1.diff --]
[-- Type: text/x-patch, Size: 4550 bytes --]

2005-03-11  Filip Navara  <navaraf@reactos.com>

	* ld/deffile.h, ld/pe-dll.c: Add support for forward exports
	in .def files passed directly to 'ld'.
	* ld/pe-dll.c (process_def_file): Don't crash on malformed
	fastcall symbol names in .def file.

--- ld/deffile.h	Sat Jun 28 07:28:54 2003
+++ ld/deffile.h	Fri Mar 11 13:41:13 2005
@@ -36,7 +36,7 @@
   char *internal_name;		/* always set, may == name */
   int ordinal;			/* -1 if not specified */
   int hint;
-  char flag_private, flag_constant, flag_noname, flag_data;
+  char flag_private, flag_constant, flag_noname, flag_data, flag_forward;
 } def_file_export;
 
 typedef struct def_file_module {
--- ld/pe-dll.c	Sun Oct 24 03:00:12 2004
+++ ld/pe-dll.c	Fri Mar 11 14:36:31 2005
@@ -596,8 +611,13 @@
 		 have.  */
 	      int lead_at = (*pe_def_file->exports[i].name == '@');
 	      char *tmp = xstrdup (pe_def_file->exports[i].name + lead_at);
+	      char *tmp_at = strchr (tmp, '@');
 
-	      *(strchr (tmp, '@')) = 0;
+	      if (tmp_at)
+	        *tmp_at = 0;
+	      else
+	        einfo (_("%XCannot export %s: invalid export name\n"),
+		       pe_def_file->exports[i].name);
 	      pe_def_file->exports[i].name = tmp;
 	    }
 	}
@@ -680,6 +700,27 @@
     {
       char *name;
 
+      /* Check for forward exports */
+      if (strchr (pe_def_file->exports[i].internal_name, '.'))
+	{
+	  count_exported++;
+	  if (!pe_def_file->exports[i].flag_noname)
+	    count_exported_byname++;
+
+	  pe_def_file->exports[i].flag_forward = 1;
+
+	  if (pe_def_file->exports[i].ordinal != -1)
+	    {
+	      if (max_ordinal < pe_def_file->exports[i].ordinal)
+		max_ordinal = pe_def_file->exports[i].ordinal;
+	      if (min_ordinal > pe_def_file->exports[i].ordinal)
+		min_ordinal = pe_def_file->exports[i].ordinal;
+	      count_with_ordinals++;
+	    }
+
+	  continue;
+	}
+
       name = xmalloc (strlen (pe_def_file->exports[i].internal_name) + 2);
       if (pe_details->underscored
  	  && (*pe_def_file->exports[i].internal_name != '@'))
@@ -837,7 +878,8 @@
   /* Now we need to assign ordinals to those that don't have them.  */
   for (i = 0; i < NE; i++)
     {
-      if (exported_symbol_sections[i])
+      if (exported_symbol_sections[i] ||
+          pe_def_file->exports[i].flag_forward)
 	{
 	  if (pe_def_file->exports[i].ordinal != -1)
 	    {
@@ -856,19 +898,26 @@
 	    }
 	  name_table_size += strlen (pe_def_file->exports[i].name) + 1;
 	}
+
+      /* Reserve space for the forward name. */
+      if (pe_def_file->exports[i].flag_forward)
+	{
+	  name_table_size += strlen (pe_def_file->exports[i].internal_name) + 1;
+	}
     }
 
   next_ordinal = min_ordinal;
   for (i = 0; i < NE; i++)
-    if (exported_symbol_sections[i])
-      if (pe_def_file->exports[i].ordinal == -1)
-	{
-	  while (exported_symbols[next_ordinal - min_ordinal] != -1)
-	    next_ordinal++;
+    if ((exported_symbol_sections[i] ||
+         pe_def_file->exports[i].flag_forward) &&
+        pe_def_file->exports[i].ordinal == -1)
+      {
+	while (exported_symbols[next_ordinal - min_ordinal] != -1)
+	  next_ordinal++;
 
-	  exported_symbols[next_ordinal - min_ordinal] = i;
-	  pe_def_file->exports[i].ordinal = next_ordinal;
-	}
+	exported_symbols[next_ordinal - min_ordinal] = i;
+	pe_def_file->exports[i].ordinal = next_ordinal;
+      }
 
   /* OK, now we can allocate some memory.  */
   edata_sz = (40				/* directory */
@@ -967,15 +1016,28 @@
   for (s = 0; s < NE; s++)
     {
       struct bfd_section *ssec = exported_symbol_sections[s];
-      if (ssec && pe_def_file->exports[s].ordinal != -1)
+      if (pe_def_file->exports[s].ordinal != -1 &&
+          (pe_def_file->exports[s].flag_forward || ssec != NULL))
 	{
-	  unsigned long srva = (exported_symbol_offsets[s]
-				+ ssec->output_section->vma
-				+ ssec->output_offset);
 	  int ord = pe_def_file->exports[s].ordinal;
 
-	  bfd_put_32 (abfd, srva - image_base,
-		      eaddresses + 4 * (ord - min_ordinal));
+	  if (pe_def_file->exports[s].flag_forward)
+	    {
+	      bfd_put_32 (abfd, ERVA (enamestr),
+		          eaddresses + 4 * (ord - min_ordinal));
+
+	      strcpy (enamestr, pe_def_file->exports[s].internal_name);
+	      enamestr += strlen (pe_def_file->exports[s].internal_name) + 1;
+	    }
+	  else
+	    {
+	      unsigned long srva = (exported_symbol_offsets[s]
+				    + ssec->output_section->vma
+				    + ssec->output_offset);
+
+	      bfd_put_32 (abfd, srva - image_base,
+		          eaddresses + 4 * (ord - min_ordinal));
+	    }
 
 	  if (!pe_def_file->exports[s].flag_noname)
 	    {

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

* Re: [PATCH] Support forward exports in .def files
  2005-03-11 14:26 [PATCH] Support forward exports in .def files Filip Navara
@ 2005-03-24 22:42 ` Christopher Faylor
  2005-03-25  3:18   ` Filip Navara
  2006-01-25  8:31 ` Danny Smith
  1 sibling, 1 reply; 9+ messages in thread
From: Christopher Faylor @ 2005-03-24 22:42 UTC (permalink / raw)
  To: Filip Navara, binutils

[reply-to set]
On Fri, Mar 11, 2005 at 03:25:44PM +0100, Filip Navara wrote:
>Changelog:
>
>2005-03-11  Filip Navara  <navaraf@reactos.com>
>
>   * ld/deffile.h, ld/pe-dll.c: Add support for forward exports
>   in .def files passed directly to 'ld'.
>   * ld/pe-dll.c (process_def_file): Don't crash on malformed
>   fastcall symbol names in .def file.
>

>2005-03-11  Filip Navara  <navaraf@reactos.com>
>
>	* ld/deffile.h, ld/pe-dll.c: Add support for forward exports
>	in .def files passed directly to 'ld'.
>	* ld/pe-dll.c (process_def_file): Don't crash on malformed
>	fastcall symbol names in .def file.

I would like to get this change into the next version of cygwin's
binutils.  You don't have a copyright assignment yet, right?  If not, is
it possible that you're actively pursuing getting one?

cgf

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

* Re: [PATCH] Support forward exports in .def files
  2005-03-24 22:42 ` Christopher Faylor
@ 2005-03-25  3:18   ` Filip Navara
  2005-03-25  3:21     ` Filip Navara
  2005-03-29 15:00     ` Nick Clifton
  0 siblings, 2 replies; 9+ messages in thread
From: Filip Navara @ 2005-03-25  3:18 UTC (permalink / raw)
  To: binutils; +Cc: binutils

Christopher Faylor wrote:

>[reply-to set]
>On Fri, Mar 11, 2005 at 03:25:44PM +0100, Filip Navara wrote:
>  
>
>>Changelog:
>>
>>2005-03-11  Filip Navara  <navaraf@reactos.com>
>>
>>  * ld/deffile.h, ld/pe-dll.c: Add support for forward exports
>>  in .def files passed directly to 'ld'.
>>  * ld/pe-dll.c (process_def_file): Don't crash on malformed
>>  fastcall symbol names in .def file.
>>
>>    
>>
>I would like to get this change into the next version of cygwin's
>binutils.  You don't have a copyright assignment yet, right?
>
Correct.

>If not, is it possible that you're actively pursuing getting one?
>  
>
Can you please point me out where can I get the necessary forms? I was 
hoping that this patch can still be considered as a small change, but 
I'll need to get the assignment anyway... I'm only worried that the 
whole process can take considerable amount of time.

- Filip Navara

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

* Re: [PATCH] Support forward exports in .def files
  2005-03-25  3:18   ` Filip Navara
@ 2005-03-25  3:21     ` Filip Navara
  2005-03-29 15:00     ` Nick Clifton
  1 sibling, 0 replies; 9+ messages in thread
From: Filip Navara @ 2005-03-25  3:21 UTC (permalink / raw)
  To: binutils; +Cc: binutils

Christopher Faylor wrote:

>[reply-to set]
>On Fri, Mar 11, 2005 at 03:25:44PM +0100, Filip Navara wrote:
>  
>
>>Changelog:
>>
>>2005-03-11  Filip Navara  <navaraf@reactos.com>
>>
>>  * ld/deffile.h, ld/pe-dll.c: Add support for forward exports
>>  in .def files passed directly to 'ld'.
>>  * ld/pe-dll.c (process_def_file): Don't crash on malformed
>>  fastcall symbol names in .def file.
>>
>>    
>>
>I would like to get this change into the next version of cygwin's
>binutils.  You don't have a copyright assignment yet, right?
>
Correct.

>If not, is it possible that you're actively pursuing getting one?
>  
>
Can you please point me out where can I get the necessary forms? I was 
hoping that this patch can still be considered as a small change, but 
I'll need to get the assignment anyway... I'm only worried that the 
whole process can take considerable amount of time.

- Filip Navara

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

* Re: [PATCH] Support forward exports in .def files
  2005-03-25  3:18   ` Filip Navara
  2005-03-25  3:21     ` Filip Navara
@ 2005-03-29 15:00     ` Nick Clifton
  1 sibling, 0 replies; 9+ messages in thread
From: Nick Clifton @ 2005-03-29 15:00 UTC (permalink / raw)
  To: Filip Navara; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 416 bytes --]

Hi Filip,

>> I would like to get this change into the next version of cygwin's
>> binutils.  You don't have a copyright assignment yet, right?
>>
> Correct.

>> If not, is it possible that you're actively pursuing getting one?
>>  
>>
> Can you please point me out where can I get the necessary forms?

The form is attached.  Please fill it out and email it to the address 
specified on the form.

Cheers
   Nick



[-- Attachment #2: future --]
[-- Type: text/plain, Size: 1005 bytes --]

---------------------------------------------------------------------------

request-assign.future:

Please email the following information to fsf-records@gnu.org, and we
will send you the assignment form for your past and future changes.
Please use your full name as the subject line of the message.


[What is the name of the program or package you're contributing to?]


[Did you copy any files or text written by someone else in these changes?
Even if that material is free software, we need to know about it.]


[Do you have an employer who might have a basis to claim to own
your changes?  Do you attend a school which might make such a claim?]


[For the copyright registration, what country are you a citizen of?]


[What year were you born?]


[Please write your email address here.]


[Please write your snail address here.]





[Which files have you changed so far, and which new files have you written
so far?]





---------------------------------------------------------------------------

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

* Re: [PATCH] Support forward exports in .def files
  2005-03-11 14:26 [PATCH] Support forward exports in .def files Filip Navara
  2005-03-24 22:42 ` Christopher Faylor
@ 2006-01-25  8:31 ` Danny Smith
  2006-01-26 15:00   ` Nick Clifton
  1 sibling, 1 reply; 9+ messages in thread
From: Danny Smith @ 2006-01-25  8:31 UTC (permalink / raw)
  To: binutils; +Cc: Filip Navara

> Changelog:
>
> 2005-03-11  Filip Navara  <navaraf@reactos.com>
>
> * ld/deffile.h, ld/pe-dll.c: Add support for forward exports
> in .def files passed directly to 'ld'.
> * ld/pe-dll.c (process_def_file): Don't crash on malformed
> fastcall symbol names in .def file.
>

When this patch was submitted,  Filip was asked to complete FSF copyright
assignments.
The  has been done (#231082).

Can this patch go in now?


Danny

> --- ld/deffile.h Sat Jun 28 07:28:54 2003
> +++ ld/deffile.h Fri Mar 11 13:41:13 2005
> @@ -36,7 +36,7 @@
>    char *internal_name; /* always set, may == name */
>    int ordinal; /* -1 if not specified */
>    int hint;
> -  char flag_private, flag_constant, flag_noname, flag_data;
> +  char flag_private, flag_constant, flag_noname, flag_data, flag_forward;
>  } def_file_export;
>
>  typedef struct def_file_module {
> --- ld/pe-dll.c Sun Oct 24 03:00:12 2004
> +++ ld/pe-dll.c Fri Mar 11 14:36:31 2005
> @@ -596,8 +611,13 @@
>   have.  */
>         int lead_at = (*pe_def_file->exports[i].name == '@');
>         char *tmp = xstrdup (pe_def_file->exports[i].name + lead_at);
> +       char *tmp_at = strchr (tmp, '@');
>
> -       *(strchr (tmp, '@')) = 0;
> +       if (tmp_at)
> +         *tmp_at = 0;
> +       else
> +         einfo (_("%XCannot export %s: invalid export name\n"),
> +        pe_def_file->exports[i].name);
>         pe_def_file->exports[i].name = tmp;
>       }
>   }
> @@ -680,6 +700,27 @@
>      {
>        char *name;
>
> +      /* Check for forward exports */
> +      if (strchr (pe_def_file->exports[i].internal_name, '.'))
> + {
> +   count_exported++;
> +   if (!pe_def_file->exports[i].flag_noname)
> +     count_exported_byname++;
> +
> +   pe_def_file->exports[i].flag_forward = 1;
> +
> +   if (pe_def_file->exports[i].ordinal != -1)
> +     {
> +       if (max_ordinal < pe_def_file->exports[i].ordinal)
> + max_ordinal = pe_def_file->exports[i].ordinal;
> +       if (min_ordinal > pe_def_file->exports[i].ordinal)
> + min_ordinal = pe_def_file->exports[i].ordinal;
> +       count_with_ordinals++;
> +     }
> +
> +   continue;
> + }
> +
>        name = xmalloc (strlen (pe_def_file->exports[i].internal_name) + 2);
>        if (pe_details->underscored
>     && (*pe_def_file->exports[i].internal_name != '@'))
> @@ -837,7 +878,8 @@
>    /* Now we need to assign ordinals to those that don't have them.  */
>    for (i = 0; i < NE; i++)
>      {
> -      if (exported_symbol_sections[i])
> +      if (exported_symbol_sections[i] ||
> +          pe_def_file->exports[i].flag_forward)
>   {
>     if (pe_def_file->exports[i].ordinal != -1)
>       {
> @@ -856,19 +898,26 @@
>       }
>     name_table_size += strlen (pe_def_file->exports[i].name) + 1;
>   }
> +
> +      /* Reserve space for the forward name. */
> +      if (pe_def_file->exports[i].flag_forward)
> + {
> +   name_table_size += strlen (pe_def_file->exports[i].internal_name) + 1;
> + }
>      }
>
>    next_ordinal = min_ordinal;
>    for (i = 0; i < NE; i++)
> -    if (exported_symbol_sections[i])
> -      if (pe_def_file->exports[i].ordinal == -1)
> - {
> -   while (exported_symbols[next_ordinal - min_ordinal] != -1)
> -     next_ordinal++;
> +    if ((exported_symbol_sections[i] ||
> +         pe_def_file->exports[i].flag_forward) &&
> +        pe_def_file->exports[i].ordinal == -1)
> +      {
> + while (exported_symbols[next_ordinal - min_ordinal] != -1)
> +   next_ordinal++;
>
> -   exported_symbols[next_ordinal - min_ordinal] = i;
> -   pe_def_file->exports[i].ordinal = next_ordinal;
> - }
> + exported_symbols[next_ordinal - min_ordinal] = i;
> + pe_def_file->exports[i].ordinal = next_ordinal;
> +      }
>
>    /* OK, now we can allocate some memory.  */
>    edata_sz = (40 /* directory */
> @@ -967,15 +1016,28 @@
>    for (s = 0; s < NE; s++)
>      {
>        struct bfd_section *ssec = exported_symbol_sections[s];
> -      if (ssec && pe_def_file->exports[s].ordinal != -1)
> +      if (pe_def_file->exports[s].ordinal != -1 &&
> +          (pe_def_file->exports[s].flag_forward || ssec != NULL))
>   {
> -   unsigned long srva = (exported_symbol_offsets[s]
> - + ssec->output_section->vma
> - + ssec->output_offset);
>     int ord = pe_def_file->exports[s].ordinal;
>
> -   bfd_put_32 (abfd, srva - image_base,
> -       eaddresses + 4 * (ord - min_ordinal));
> +   if (pe_def_file->exports[s].flag_forward)
> +     {
> +       bfd_put_32 (abfd, ERVA (enamestr),
> +           eaddresses + 4 * (ord - min_ordinal));
> +
> +       strcpy (enamestr, pe_def_file->exports[s].internal_name);
> +       enamestr += strlen (pe_def_file->exports[s].internal_name) + 1;
> +     }
> +   else
> +     {
> +       unsigned long srva = (exported_symbol_offsets[s]
> +     + ssec->output_section->vma
> +     + ssec->output_offset);
> +
> +       bfd_put_32 (abfd, srva - image_base,
> +           eaddresses + 4 * (ord - min_ordinal));
> +     }
>
>     if (!pe_def_file->exports[s].flag_noname)
>       {
>

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

* Re: [PATCH] Support forward exports in .def files
  2006-01-25  8:31 ` Danny Smith
@ 2006-01-26 15:00   ` Nick Clifton
  2006-01-29  0:21     ` Danny Smith
  0 siblings, 1 reply; 9+ messages in thread
From: Nick Clifton @ 2006-01-26 15:00 UTC (permalink / raw)
  To: Danny Smith; +Cc: binutils, Filip Navara

Hi Danny,

>> Changelog:
>> 2005-03-11  Filip Navara  <navaraf@reactos.com>
>>
>> * ld/deffile.h, ld/pe-dll.c: Add support for forward exports
>> in .def files passed directly to 'ld'.
>> * ld/pe-dll.c (process_def_file): Don't crash on malformed
>> fastcall symbol names in .def file.
>>
> 
> When this patch was submitted,  Filip was asked to complete FSF copyright
> assignments.
> The  has been done (#231082).
> 
> Can this patch go in now?

Yes - please apply it - but ... I think this new feature ought to be 
documented in ld/ld.texinfo and mentioned in ld/NEWS, don't you ?

Cheers
   Nick


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

* Re: [PATCH] Support forward exports in .def files
  2006-01-26 15:00   ` Nick Clifton
@ 2006-01-29  0:21     ` Danny Smith
  2006-01-30  9:36       ` Nick Clifton
  0 siblings, 1 reply; 9+ messages in thread
From: Danny Smith @ 2006-01-29  0:21 UTC (permalink / raw)
  To: Nick Clifton; +Cc: binutils, Filip Navara

From: "Nick Clifton"
Sent: Friday, 27 January 2006 04:07


> Hi Danny,
>
> >> Changelog:
> >> 2005-03-11  Filip Navara  <navaraf@reactos.com>
> >>
> >> * ld/deffile.h, ld/pe-dll.c: Add support for forward exports
> >> in .def files passed directly to 'ld'.
> >> * ld/pe-dll.c (process_def_file): Don't crash on malformed
> >> fastcall symbol names in .def file.
> >>
> >
> > When this patch was submitted,  Filip was asked to complete FSF copyright
> > assignments.
> > The  has been done (#231082).
> >
> > Can this patch go in now?
>
> Yes - please apply it - but ... I think this new feature ought to be
> documented in ld/ld.texinfo and mentioned in ld/NEWS, don't you ?
>
> Cheers
>    Nick


How about this.  There is a lot more that can be added to the documentation,
based on what is indicated in comments in binutils/dlltool.c.  I'll add more as
I confirm that these comments are actually valid for the ld/deffilep.y
implementation.

Danny


Changelog

2006-01-28  Danny Smith  dannysmith@users.sourceforge.net

        * NEWS: mention support for forward exports in PE-COFF dll's.
        * ld.texinfo: Expand documentation of EXPORT statements in PE-COFF .def
files.



Index: NEWS
===================================================================
RCS file: /cvs/src/src/ld/NEWS,v
retrieving revision 1.61
diff -c -3 -p -r1.61 NEWS
*** NEWS 25 Oct 2005 17:40:11 -0000 1.61
--- NEWS 28 Jan 2006 23:56:33 -0000
***************
*** 1,5 ****
--- 1,8 ----
  -*- text -*-

+ * PE-COFF: Forward exports from DLL's can now be specified in .def files
+   passed directly to ld.
+
  * Support for the Z80 processor family has been added.

  * Add support for the "@<file>" syntax to the command line, so that extra
Index: ld.texinfo
===================================================================
RCS file: /cvs/src/src/ld/ld.texinfo,v
retrieving revision 1.154
diff -c -3 -p -r1.154 ld.texinfo
*** ld.texinfo 16 Jan 2006 16:07:45 -0000 1.154
--- ld.texinfo 28 Jan 2006 23:56:55 -0000
*************** Using a DEF file turns off the normal au
*** 5581,5597 ****
  Here is an example of a DEF file for a shared library called @samp{xyz.dll}:

  @example
! LIBRARY "xyz.dll" BASE=0x10000000

  EXPORTS
  foo
  bar
  _bar = bar
  @end example

! This example defines a base address and three symbols.  The third
! symbol is an alias for the second.  For the complete format
! specification see ld/deffilep.y in the binutils sources.

  @cindex creating a DEF file
  While linking a shared dll, @command{ld} is able to create a DEF file
--- 5581,5647 ----
  Here is an example of a DEF file for a shared library called @samp{xyz.dll}:

  @example
! LIBRARY "xyz.dll" BASE=0x20000000

  EXPORTS
  foo
  bar
  _bar = bar
+ another_foo = abc.dll.afoo
+ var1 DATA
  @end example

! This example defines a DLL with a non-default base address and five
! symbols in the export table. The third exported symbol @code{_bar} is an
! alias for the second. The fourth symbol, @code{another_foo} is resolved
! by "forwarding" to another module and treating it as an alias for
! @code{afoo} exported from the DLL @samp{abc.dll}. The final symbol
! @code{var1} is declared to be a data object.
!
! The complete specification of an export symbol is:
!
! @example
! EXPORTS
!   ( ( ( <name1> [ = <name2> ] )
!      | ( <name1> = <module-name> . <external-name>))
!   [ @@ <integer> ] [ NONAME ] [ DATA ] [ CONSTANT ] [ PRIVATE ] ) *
! @end example
!
! Declares @samp{<name1>} as an exported symbol from the DLL, or declares
! @samp{<name1>} as an exported alias for @samp{<name2>}; or declares
! @samp{<name1>} as a "forward" alias for the symbol
! @samp{<external-name>} in the DLL @samp{<module-name>}.
! Optionally, the symbol may be exported by the specified ordinal
! @samp{<integer>} alias.
!
! The optional keywords that follow the declaration indicate:
!
! @code{NONAME}: Do not put the symbol name in the DLL's export table.  It
! will still be exported by its ordinal alias (either the value specified
! by the .def specification or, otherwise, the value assigned by the
! linker). The symbol name, however, does remain visible in the import
! library (if any), unless @code{PRIVATE} is also specified.
!
! @code{DATA}: The symbol is a variable or object, rather than a function.
! The import lib will export only an indirect reference to @code{foo} as
! the symbol @code{_imp__foo} (ie, @code{foo} must be resolved as
! @code{*_imp__foo}).
!
! @code{CONSTANT}: Like @code{DATA}, but put the undecorated @code{foo} as
! well as @code{_imp__foo} into the import library. Both refer to the read-only
! import address table's pointer to the variable. This can be dangerous.
! If the user code fails to add the @code{dllimport} attribute and also fails
! to explicitly add the extra indirection that the use of the attribute
! enforces, the application will behave unexpectedly.
!
! @code{PRIVATE}: Put the symbol in the DLL's export table, but do not put
! it into the static import library used to resolve imports at link time. The
! symbol can still be imported using the @code{LoadLibrary/GetProcAddress}
! API at runtime or by by using the GNU ld extension of linking directly to
! the DLL without an import library.
!
! See ld/deffilep.y in the binutils sources for the full specification of
! other DEF file statements

  @cindex creating a DEF file
  While linking a shared dll, @command{ld} is able to create a DEF file
>

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

* Re: [PATCH] Support forward exports in .def files
  2006-01-29  0:21     ` Danny Smith
@ 2006-01-30  9:36       ` Nick Clifton
  0 siblings, 0 replies; 9+ messages in thread
From: Nick Clifton @ 2006-01-30  9:36 UTC (permalink / raw)
  To: Danny Smith; +Cc: binutils, Filip Navara

Hi Danny,

> 2006-01-28  Danny Smith  dannysmith@users.sourceforge.net
> 
>         * NEWS: mention support for forward exports in PE-COFF dll's.
>         * ld.texinfo: Expand documentation of EXPORT statements in PE-COFF .def
> files.

Approved - please apply.  Thanks.

Cheers
   Nick

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

end of thread, other threads:[~2006-01-30  9:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-11 14:26 [PATCH] Support forward exports in .def files Filip Navara
2005-03-24 22:42 ` Christopher Faylor
2005-03-25  3:18   ` Filip Navara
2005-03-25  3:21     ` Filip Navara
2005-03-29 15:00     ` Nick Clifton
2006-01-25  8:31 ` Danny Smith
2006-01-26 15:00   ` Nick Clifton
2006-01-29  0:21     ` Danny Smith
2006-01-30  9:36       ` Nick Clifton

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