From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38681 invoked by alias); 28 Mar 2016 22:38:05 -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 38665 invoked by uid 89); 28 Mar 2016 22:38:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=prevailing, winds X-HELO: mail-ig0-f177.google.com Received: from mail-ig0-f177.google.com (HELO mail-ig0-f177.google.com) (209.85.213.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 28 Mar 2016 22:38:03 +0000 Received: by mail-ig0-f177.google.com with SMTP id ma7so20135258igc.0 for ; Mon, 28 Mar 2016 15:38:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=xhZrHGtHubNkWNJh0Wiwrnu0YDSG1u+PK8dU1YsAZWw=; b=D5Z0s5QTyHgadsJ2LYOrV3nYWiQKMrtkf0kpj6ntecZEXJ+SRIZKZVvr2qCFyRTa3j /WtXcIAYrBG0tu/RYt+nRatu6ePV8xGdDb1M4f6nfzQb1pjMly9pwJU2bAwxmsvOibWK FlLbr7u8/rPZ2IVRbUa1avioVreUphUbXLZn1zSCpt2jxWJRbv++sWPCC2C/a/WP7lxC HjPqAbWDYt2oOWg5Ys4Y/dNeQcg0bY9yVbWwi6+eUYR9hzQPtvETPe2Q6I7syF7aSOT9 Zsn+27/mC4oMR1ziqIJ5dkzEnoMkszcvQi7fxM2bX0GJ0qE5JYkCuw0oiyha+u3E+LcE A45w== X-Gm-Message-State: AD7BkJJzbswlPUFSVAlnhIq4HGbJx+TfmEDTGPJQpzQsu5/Ns4Uirooiw0nQ1fA2V66eSAU4/RH7GeHBTt1BQg== MIME-Version: 1.0 X-Received: by 10.50.138.8 with SMTP id qm8mr11639987igb.50.1459204681289; Mon, 28 Mar 2016 15:38:01 -0700 (PDT) Received: by 10.36.200.8 with HTTP; Mon, 28 Mar 2016 15:38:01 -0700 (PDT) In-Reply-To: <08556ECF-C47B-400E-91A2-56D338E55D86@apple.com> References: <9106B2FB-BB06-413A-A04D-EEFB992784FA@apple.com> <9EFBBDCE-4054-4867-B3E9-9DFE216A234F@apple.com> <08556ECF-C47B-400E-91A2-56D338E55D86@apple.com> Date: Mon, 28 Mar 2016 22:38:00 -0000 Message-ID: Subject: Re: Preventing preemption of 'protected' symbols in GNU ld 2.26 From: Cary Coutant To: Joe Groff Cc: "H.J. Lu" , Binutils Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00354.txt.bz2 >>> 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? >> >> There wouldn't be a measurable cost in dirty pages; the copied objects >> are simply allocated in bss in the executable. > > Wouldn't references to the symbol from within the .so need to be relocated to reference the now-canonical copy in the executable? 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. -cary