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]

Re: [PATCH] Windows/PE: Do not create empty export table.


> OK to commit?
>
> 2004-08-06  Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com>
>
>        * pe-dll.c (process_def_file): Do not create empty export table.
>
>        * ld-pe/exports.d: New file.
>        * ld-pe/exports.s: New file.
>        * ld-pe/pe.exp: New test for empty export table.
>
> Index: ld/pe-dll.c
> ===================================================================
> RCS file: /cvs/src/src/ld/pe-dll.c,v
> retrieving revision 1.107
> diff -u -p -r1.107 pe-dll.c
> --- ld/pe-dll.c 31 Jul 2008 07:27:52 -0000      1.107
> +++ ld/pe-dll.c 7 Aug 2008 05:56:36 -0000
> @@ -603,10 +603,9 @@ process_def_file (bfd *abfd ATTRIBUTE_UN
>        }
>     }
>
> -  /* If we are not building a DLL, when there are no exports
> +  /* If there are no exports
>      we do not build an export table at all.  */
> -  if (!pe_dll_export_everything && pe_def_file->num_exports == 0
> -      && info->executable)
> +  if (!pe_dll_export_everything && pe_def_file->num_exports == 0)
>     return;
>
>   /* Now, maybe export everything else the default way.  */


This patch will also change the default behaviour to "export
everything else the default way"
when there is no .def file and no symbols marked with  export directive"

Shouldn't we rather test for an empty export table later on like so:

Index: pe-dll.c
===================================================================
RCS file: /cvs/src/src/ld/pe-dll.c,v
retrieving revision 1.107
diff -c -3 -p -r1.107 pe-dll.c
*** pe-dll.c	31 Jul 2008 07:27:52 -0000	1.107
--- pe-dll.c	7 Aug 2008 09:03:44 -0000
*************** process_def_file (bfd *abfd ATTRIBUTE_UN
*** 667,672 ****
--- 667,676 ----
  #undef NE
  #define NE pe_def_file->num_exports

+   /* Don't create an empty export table.  */
+   if ( NE == 0)
+     return;
+
    /* Canonicalize the export list.  */
    if (pe_dll_kill_ats)
      {

Danny


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