delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/08/27/11:22:43

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>,
<http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-Id: <199908271515.KAA20714@mercury.xraylith.wisc.edu>
To: Paul Sokolovsky <paul-ml AT is DOT lg DOT ua>
cc: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: Re[6]: Importing a variable from a DLL
In-Reply-To: Your message of "Fri, 27 Aug 1999 18:00:26 +0400."
<4750 DOT 990827 AT is DOT lg DOT ua>
Date: Fri, 27 Aug 1999 10:15:51 -0500
From: Mumit Khan <khan AT xraylith DOT wisc DOT EDU>

Paul Sokolovsky <paul-ml AT is DOT lg DOT ua> writes:
> 
>     I also made mine, it requires changing only dlltool.c: (against
> b20 distribution)
> 
> *** dlltool.c.org       Tue Oct 27 03:04:10 1998
> --- dlltool.c   Thu Aug 26 22:31:32 1999
> ***************
> *** 1144,1149 ****
> --- 1144,1150 ----
>       {
>         asymbol *sym;
>         const char *symbol_name;
> +       int data;
> 
>         sym = bfd_minisymbol_to_symbol (abfd, false, from, store);
>         if (sym == NULL)
> ***************
> *** 1153,1166 ****
>         if (bfd_get_symbol_leading_char (abfd) == symbol_name[0])
>         ++symbol_name;
> 
> !       def_exports (xstrdup (symbol_name) , 0, -1, 0, 0, 0);
> 
>         if (add_stdcall_alias && strchr (symbol_name, '@'))
>           {
>           char *exported_name = xstrdup (symbol_name);
>           char *atsym = strchr (exported_name, '@');
>           *atsym = '\0';
> !         def_exports (exported_name, xstrdup (symbol_name), -1, 0, 0, 0);
>         }
>       }
>   }
> --- 1154,1171 ----
>         if (bfd_get_symbol_leading_char (abfd) == symbol_name[0])
>         ++symbol_name;
> 
> ! /* Don't use bfd_decode_symclass() - remember, symbols with constant
> !    values dumped to code section */
> !       data = !(sym->flags&BSF_FUNCTION);
> !
> !       def_exports (xstrdup (symbol_name) , 0, -1, 0, 0, data);
> 
>         if (add_stdcall_alias && strchr (symbol_name, '@'))
>           {
>           char *exported_name = xstrdup (symbol_name);
>           char *atsym = strchr (exported_name, '@');
>           *atsym = '\0';
> !         def_exports (exported_name, xstrdup (symbol_name), -1, 0, 0, data);
>         }
>       }
>   }
> 

Thanks.

This is only a partial solution for --export-all case. The other one is
handled by looking at .drectve section for symbols exported explicitly
via dllexport attribute. See scan_drectve_symbols in dlltool.c. A small
GCC change is necessary to support that one. 

btw, please use the -p option when creating diffs; it helps to see the
function name in the patch.

Regards,
Mumit


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019