Re: Who have already used the new GCC option "-fvisibility=hidden" in Mingw+Msys?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Duft Markus wrote:

> Huh? Doesn't PE support symbol visibility in shared libraries etc. by
> default, and much, much much longer and better than ELF / gcc? I just
> wonder, because i'm not sure if the same stuff is meant here (I'm
> thinking of dllexport/dllimport and such...)

If you want to call dllimport/dllexport visibility then fine, but it's
not the same kind of visibility that -fvisibility=hidden refers to.

If you want to selectively expose only certain symbols on PE you do it
by declaring them __declspec(dllexport) or linking with a def file that
lists them.  In that sense the default PE visibility is already hidden
since you have to manually mark everything you want exported.  For ease
in porting software however, the PE linker enables auto-export mode if
you do neither of these things (no __declspec(dllexport) used anywhere
and no def file) which means everything is exported.

In any case, this doesn't change the fact that -fvisibility and/or
__attribute__ ((visibility ("foo")) are only relevant on ELF.  Or put
differently, the two platforms handle things in different ways so the
ELF way is not applicable to PE.

Brian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux