This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Updated] dllimport/dllexport attributes for Win32/BeOS
- To: Mumit Khan <khan at xraylith dot wisc dot edu>
- Subject: Re: [Updated] dllimport/dllexport attributes for Win32/BeOS
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Thu, 25 Jun 1998 01:34:01 -0600
- cc: egcs-patches at cygnus dot com
- Reply-To: law at cygnus dot com
In message <9806230021.AA11518@modi.xraylith.wisc.edu>you write:
> This work is largely due to Doug Evans' work on ARM/PE at Cygnus.
>
> The meat of this patch is about 4 lines of code, and the rest is really
> support stuff. See i386_pe_mark_dll{import,export} for RTL mucking.
>
> These patches do not affect code not using the new attributes, and even
> when used, can be reverted to old behavior with -fnop-fun-dllimport.
>
> Patches are against egcs-19980622 CVS tree. No testsuite regressions for
> i386-cygwin32 and i386-mingw32.
I'm going to basically assume that whatever you do in the x86
windows support files is OK.
> Index: gcc/tree.c
> ===================================================================
> RCS file: /egcs/carton/cvsfiles/egcs/gcc/tree.c,v
> retrieving revision 1.33
> diff -u -3 -p -r1.33 tree.c
> --- tree.c 1998/06/20 00:35:42 1.33
> +++ tree.c 1998/06/22 23:48:53
> @@ -2256,10 +2256,26 @@ staticp (arg)
> switch (TREE_CODE (arg))
> {
> case FUNCTION_DECL:
> + /* Don't treat global scope DLL imported functions as static since
> + taking their address involves initialization. */
> + if (global_bindings_p ()
> + && lookup_attribute ("dllimport", DECL_MACHINE_ATTRIBUTES(arg))
> + != NULL_TREE)
> + {
> + return 0;
> + }
This is pretty hokey. You're checking a machine dependent attribute
in generic code. We'd be better off making the attribute a first class
attribute instead of a machine dependent attribute.
I'm also a little confused about why these would be considered static
to begin with since apparently they're "global scope"? Can you give
me a little more background on what's going on?
jeff