From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45198 invoked by alias); 28 Mar 2016 22:41:21 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 45187 invoked by uid 89); 28 Mar 2016 22:41:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1158 X-HELO: mail-in5.apple.com Received: from mail-out5.apple.com (HELO mail-in5.apple.com) (17.151.62.27) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 28 Mar 2016 22:41:19 +0000 Received: from relay6.apple.com (relay6.apple.com [17.128.113.90]) by mail-in5.apple.com (Apple Secure Mail Relay) with SMTP id C5.5F.03030.E03B9F65; Mon, 28 Mar 2016 15:41:18 -0700 (PDT) Received: from nwk-mmpp-sz13.apple.com (nwk-mmpp-sz13.apple.com [17.128.115.216]) (using TLS with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by relay6.apple.com (Apple SCV relay) with SMTP id AE.28.18091.D03B9F65; Mon, 28 Mar 2016 15:41:17 -0700 (PDT) Received: from [17.114.73.8] by nwk-mmpp-sz13.apple.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Mar 31 2015)) with ESMTPSA id <0O4R00IYUTOTO460@nwk-mmpp-sz13.apple.com> for binutils@sourceware.org; Mon, 28 Mar 2016 15:41:17 -0700 (PDT) Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: Preventing preemption of 'protected' symbols in GNU ld 2.26 From: Joe Groff In-reply-to: Date: Mon, 28 Mar 2016 22:41:00 -0000 Cc: "H.J. Lu" , Binutils Content-transfer-encoding: quoted-printable Message-id: <3AB69E51-F694-4CD0-862B-33F56CF4630F@apple.com> References: <9106B2FB-BB06-413A-A04D-EEFB992784FA@apple.com> <9EFBBDCE-4054-4867-B3E9-9DFE216A234F@apple.com> <08556ECF-C47B-400E-91A2-56D338E55D86@apple.com> To: Cary Coutant X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00355.txt.bz2 > On Mar 28, 2016, at 3:38 PM, Cary Coutant wrote: >=20 >>>> Did you look at what the costs were in startup time and dirty pages by= using >>>> copy relocations? What do you do if the size of the definition changes= in a >>>> new version of the library? >>>=20 >>> There wouldn't be a measurable cost in dirty pages; the copied objects >>> are simply allocated in bss in the executable. >>=20 >> Wouldn't references to the symbol from within the .so need to be relocat= ed to reference the now-canonical copy in the executable? >=20 > No, references from within the .so would have always used the GOT. > Non-protected global symbols in a shared library are still > pre-emptible, so they are always indirect, and there's always a > dynamic relocation for the GOT entry. Whether the prevailing > definition winds up in the executable or the shared library, the > dynamic loader still has to bind the symbol and apply the relocation. Ah, right, ELF symbols are preemptible by default, so you'd already be dirt= ying any pages containing data-to-data references to the symbol regardless. -Joe