On Apr  7 14:47, Jean-Pierre Flori wrote:
> Le Mon, 07 Apr 2014 16:36:18 +0200, Corinna Vinschen a écrit :
> > At this point gcc doesn't know that foo will get exported from a DLL,
> > but it generates the .def directive nevertheless.  If I create the same
> > code in gas:
> > 
> >     .text .globl nothing .def   nothing; .scl 2; .type 32; .endef
> > nothing:
> >     ret
> > 
> > then it works, but crashes if I omit the .def directive.  So it seems to
> > me you don't have to export the symbol using the dllimport/dllexport
> > directives, but you have to specify the symbol explicitely for export.
> > 
> Exactly!
> I came to the same conclusion.
> On top of that, it seems that including the export stuff does not hurt 
> when building and linking a static lib.
> 
> What's strange is that when we use the dllimport magic then it works even 
> though the symbol was not explicitely exported.

Perhaps not.  With dllimport, the calling code expects having to import
a symbol from the DLL, so it generates an IAT entry and everything works
as expected.  Along these lines, at least.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgpvm2WhOq_tV.pgp
Description: PGP signature

Reply via email to