From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 849 invoked by alias); 28 Jan 2004 23:52:23 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 829 invoked by uid 48); 28 Jan 2004 23:52:22 -0000 Date: Wed, 28 Jan 2004 23:52:00 -0000 Message-ID: <20040128235222.828.qmail@sources.redhat.com> From: "s_gccbugzilla at nedprod dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040128224951.13905.s_gccbugzilla@nedprod.com> References: <20040128224951.13905.s_gccbugzilla@nedprod.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/13905] Use of __attribute__ ((visibility("X"))) in class and struct declarations X-Bugzilla-Reason: CC X-SW-Source: 2004-01/txt/msg03656.txt.bz2 List-Id: ------- Additional Comments From s_gccbugzilla at nedprod dot com 2004-01-28 23:52 ------- (In reply to comment #6) > But every thing is default to export, sorry try again. I had actually thought there was already a -fvisibility command line option in GCC, but I was wrong. Ok to restate (this time clearly): 1. Addition of: -fvisibility=external -fvisibility=default -fvisibility=protected -fvisibility=hidden -fvisibility=internal ... to available command line options in GCC. These are chosen for compatibility with Intel's C++ compiler. When specified, the default attribute for all symbols is whichever. 2. Addition of being able to specify __attribute__ ((visibility("X"))) in class and struct declarations where X is one of: external, default, protected, hidden, internal. Now you can specify -fvisibility=hidden to GCC. All symbols will by default be hidden in the ELF export table unless the code manually specifies __attribute__ ((visibility("export"))). The result: much cleaner ELF images output. Faster dynamic linking times. 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 -- What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13905