From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8950 invoked by alias); 15 Jun 2011 13:07:22 -0000 Received: (qmail 8941 invoked by uid 22791); 15 Jun 2011 13:07:21 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,NO_DNS_FOR_FROM,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 15 Jun 2011 13:07:05 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 15 Jun 2011 06:07:04 -0700 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by orsmga002.jf.intel.com with ESMTP; 15 Jun 2011 06:07:04 -0700 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id D9326C22AC; Wed, 15 Jun 2011 06:07:01 -0700 (PDT) Date: Wed, 15 Jun 2011 13:48:00 -0000 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Cc: Jason Merrill Subject: PATCH: PR c++/49412: __dso_handle should be hidden Message-ID: <20110615130701.GA13377@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg01155.txt.bz2 Since __dso_handle is always hidden if HAVE_GAS_HIDDEN is set, it is safe to mark __dso_handle hidden if assembler supports it. OK for trunk? Thanks. H.J. --- 2011-06-15 H.J. Lu PR c++/49412 * decl.c (get_dso_handle_node): Mark __dso_handle hidden if assembler supports hidden visibility. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index f4988f9..17ba539 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -6435,6 +6435,11 @@ get_dso_handle_node (void) dso_handle_node = declare_global_var (get_identifier ("__dso_handle"), ptr_type_node); +#ifdef HAVE_GAS_HIDDEN + DECL_VISIBILITY (dso_handle_node) = VISIBILITY_HIDDEN; + DECL_VISIBILITY_SPECIFIED (dso_handle_node) = 1; +#endif + return dso_handle_node; }