public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "s_gccbugzilla at nedprod dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/9283] __attribute__((visibility ("hidden"))) not supported for class/struct
Date: Fri, 30 Jan 2004 20:51:00 -0000	[thread overview]
Message-ID: <20040130205121.16769.qmail@sources.redhat.com> (raw)
In-Reply-To: <20030112104600.9283.mueller@kde.org>


------- Additional Comments From s_gccbugzilla at nedprod dot com  2004-01-30 20:51 -------
>From bug #13905 which I posted I'd like to add the following:

This idea of Dirk's is good but I think he's coming at it the wrong way. Instead 
of labouriously specifying things as hidden individually and hoping to not 
forget any, the *default* should be hidden and you specify things as exported 
individually - here if you forget you get a link error.

Not uncoincidentally, I'm wishing to leverage the same semantics as Windows so 
that the macros commonly used on cross-platform applications merely need to be 
redefined from __declspec(dllexport) to __attribute__ ((visibility("export")) 
and no further code changes are required.

To allow this to happen, GCC would need an extra command line option to set the 
default visibility of all symbols:

-fvisibility=external
-fvisibility=default
-fvisibility=protected
-fvisibility=hidden
-fvisibility=internal

These are chosen for compatibility with Intel's C++ compiler which already 
offers the ability to mark all symbols as default non-exported in ELF output.

Why this approach is better than Dirk's: much cleaner ELF images output. Faster 
dynamic linking times as less symbols are exported. Much more scope for GCC to 
optimise object files as it now knows what RTTI info it can discard as well as 
improved COMDAT folding etc.

I in particular suffer from this as GCC generates binaries nearly twice as big 
than MSVC for identical code :( (I think it's the RTTI info for all the 
templates plus not being able to COMDAT fold most of the symbols)

References: http://people.redhat.com/drepper/dsohowto.pdf

Cheers,
Niall


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9283


  parent reply	other threads:[~2004-01-30 20:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20030112104600.9283.mueller@kde.org>
2003-05-26 22:21 ` pinskia@physics.uc.edu
2003-05-26 22:55 ` mueller@kde.org
2003-05-26 23:05 ` mueller@kde.org
2004-01-29  3:25 ` pinskia at gcc dot gnu dot org
2004-01-30  2:52 ` giovannibajo at libero dot it
2004-01-30 20:51 ` s_gccbugzilla at nedprod dot com [this message]
2004-02-01 15:52 ` mueller at kde dot org
2004-02-01 17:29 ` s_gccbugzilla at nedprod dot com
2004-02-20 16:22 ` giovannibajo at libero dot it
2004-02-20 19:33 ` s_gccbugzilla at nedprod dot com
2004-04-04 17:40 ` s_gccbugzilla at nedprod dot com
2004-04-06 22:34 ` s_gccbugzilla at nedprod dot com
2004-04-07  7:03 ` markus+gcc at gyger dot org
2004-04-07 22:17 ` s_gccbugzilla at nedprod dot com
2004-04-18  3:25 ` bryner at brianryner dot com
2004-04-18  4:19 ` s_gccbugzilla at nedprod dot com
2004-04-18  9:32 ` bryner at brianryner dot com
2004-05-18 10:15 ` s_gccbugzilla at nedprod dot com
2004-07-25 22:52 ` cvs-commit at gcc dot gnu dot org
2004-07-25 23:37 ` pinskia at gcc dot gnu dot org
2004-08-17  3:06 ` cvs-commit at gcc dot gnu dot org
2004-09-01 16:21 ` cvs-commit at gcc dot gnu dot org
     [not found] <bug-9283-4@http.gcc.gnu.org/bugzilla/>
2014-02-16 13:13 ` jackie.rosen at hushmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040130205121.16769.qmail@sources.redhat.com \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).