From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2651 invoked by alias); 27 Jul 2006 22:37:32 -0000 Received: (qmail 2629 invoked by uid 22791); 27 Jul 2006 22:37:30 -0000 X-Spam-Check-By: sourceware.org Received: from mail-out3.apple.com (HELO mail-out3.apple.com) (17.254.13.22) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 27 Jul 2006 22:37:21 +0000 Received: from relay6.apple.com (relay6.apple.com [17.128.113.36]) by mail-out3.apple.com (8.12.11/8.12.11) with ESMTP id k6RMb1gK024573; Thu, 27 Jul 2006 15:37:01 -0700 (PDT) Received: from greed.local (unknown [17.219.196.124]) by relay6.apple.com (Apple SCV relay) with ESMTP id 650021F3; Thu, 27 Jul 2006 15:37:01 -0700 (PDT) Received: by greed.local (Postfix, from userid 501) id 20D558A6594; Thu, 27 Jul 2006 15:37:33 -0700 (PDT) To: "H. J. Lu" Cc: binutils@sources.redhat.com, gcc@gcc.gnu.org Subject: Re: ld -shared -Bsymbolic and C++ shared library References: <20060716172604.GB29871@lucon.org> From: Geoffrey Keating Date: Thu, 27 Jul 2006 22:37:00 -0000 In-Reply-To: <20060716172604.GB29871@lucon.org> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2006-07/txt/msg00342.txt.bz2 "H. J. Lu" writes: > ld -shared -Bsymbolic will reduce number of dynamic relocations in > a shared library. Unfortunately, it won't work correctly with C++ > exception and maybe other language features. > > However, I think it is possible to make -shared -Bsymbolic to work > for C++ by providing a way to specify a list of symbols which must > be dynamic. We then can do > > # g++ -Wl,-Bsymbolic -shared -xxx "list of dynamic symbols" -o libfoo.so ... > > and libfoo.so written in C++ will work correctly with much fewer dynamic > relocations. You may find this would be easier to use if you just had a flag which made -Bsymbolic apply only to non-weak symbols.