From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9243 invoked by alias); 16 Apr 2013 10:08:59 -0000 Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org Received: (qmail 9219 invoked by uid 89); 16 Apr 2013 10:08:59 -0000 X-Spam-SWARE-Status: No, score=-6.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_GC,TW_LG autolearn=ham version=3.3.1 X-Spam-User: qpsmtpd, 2 recipients Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 16 Apr 2013 10:08:58 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3GA8vf4023537 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 16 Apr 2013 06:08:57 -0400 Received: from zalov.cz (vpn-57-214.rdu2.redhat.com [10.10.57.214]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r3GA8tPd023294 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Apr 2013 06:08:56 -0400 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.cz (8.14.5/8.14.5) with ESMTP id r3GA8r9M005828; Tue, 16 Apr 2013 12:08:54 +0200 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id r3GA8qqR005827; Tue, 16 Apr 2013 12:08:52 +0200 Date: Tue, 16 Apr 2013 10:08:00 -0000 From: Jakub Jelinek To: Andreas Schwab Cc: java-patches@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fix linking with -findirect-dispatch Message-ID: <20130416100851.GP12880@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20130416083855.GM12880@tucnak.redhat.com> <20130416091929.GN12880@tucnak.redhat.com> <20130416094852.GO12880@tucnak.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013-q2/txt/msg00029.txt.bz2 On Tue, Apr 16, 2013 at 11:57:54AM +0200, Andreas Schwab wrote: > Jakub Jelinek writes: > > > Why would that be a problem? libgcj.so the linker sees (i.e. the dummy > > library) doesn't intentionally have DT_NEEDED libgcj.so.N, programs and > > shared libraries linked with -findirect-dispatch should be adding > > libgcj_bc.so to DT_NEEDED, not libgcj.so.N. > > But the dummy libgcj_bc.so doesn't define _Jv_MonitorExit, or any other > relevant symbol. That is not true. Build from yesterday, on x86_64-linux: $ readelf -Wa libjava/.libs/libgcj_bc.so | grep _Jv_MonitorExit; readelf -d libjava/.libs/libgcj_bc.so | grep NEEDED; echo ==; readelf -Wa libjava/.libs/libgcj_bc.so.1 | grep _Jv_MonitorExit; readelf -d libjava/.libs/libgcj_bc.so.1 | grep NEEDED 25: 0000000000001250 2 FUNC GLOBAL DEFAULT 10 _Jv_MonitorExit 77: 0000000000001250 2 FUNC GLOBAL DEFAULT 10 _Jv_MonitorExit 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1] == 0x0000000000000001 (NEEDED) Shared library: [libgcj.so.14] The point of -findirect-dispatch linking against -lgcj_bc rather than -lgcj is that whenever N in libgcj.so.N is bumped, you don't need to rebuild all the -findirect-dispatch compiled/linked programs and shared libraries, only if you build a direct dispatch programs or shared libraries. So, -findirect-dispatch programs and shared libraries should have: 0x0000000000000001 (NEEDED) Shared library: [libgcj_bc.so.1] rather than: 0x0000000000000001 (NEEDED) Shared library: [libgcj.so.14] Jakub