From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118213 invoked by alias); 30 Mar 2016 01:46:54 -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 118169 invoked by uid 89); 30 Mar 2016 01:46:53 -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=complaint, complaints, Over, clients X-HELO: mail-ig0-f173.google.com Received: from mail-ig0-f173.google.com (HELO mail-ig0-f173.google.com) (209.85.213.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 30 Mar 2016 01:46:43 +0000 Received: by mail-ig0-f173.google.com with SMTP id ui10so20229103igc.1 for ; Tue, 29 Mar 2016 18:46:43 -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:content-transfer-encoding; bh=jjF6pDwWiy2Pkx+uWuTPVxxhBabEKP2ItHq3LIRHUSw=; b=VBcsJjWsCHoUjy3P8Buo+LfqQC7b3ajvtuuXW22yNa+G1m19Pm7d7VaK3fA7RSZMJ2 ijDzYuJWM84yyxCEwRj6cISMpCZ/1C0EXp3549cUgY3jaXehQ8zi5LhLobP7aW+g4wsb JwDG2GlpqdC8TVBsP+4YGVXqnJnu+VOaEMdj91ctXCqPH/NYrEDtH+ZYZAqtULODgxjd 3+hm2QEj6Wkumdvk8Dnnx4KOT025Cd+1BC8+Pk0AyVE/8tivOo5/sARpyiVxWhFRpssJ FEtT9vRLMOheUF2EsD7ARZl8BnddjY0uxW9zjuJTEUtfrPoy2XXsF8W3RygCGH72fDHj EClA== X-Gm-Message-State: AD7BkJKezzcQGNknxOMqT0opYbPvqVlD/lMHantnBLgh3S9wVmB8T1bhUqYMRZnf/p2SC+zjyUWQUxziKHK6eg== MIME-Version: 1.0 X-Received: by 10.50.65.1 with SMTP id t1mr20017895igs.34.1459302401508; Tue, 29 Mar 2016 18:46:41 -0700 (PDT) Received: by 10.36.200.8 with HTTP; Tue, 29 Mar 2016 18:46:40 -0700 (PDT) In-Reply-To: References: <983472E1-A1BC-4970-9CF9-0138A6BAD16D@apple.com> <6AAD87D2-90F9-4AD7-A195-AC91B76EA6AE@apple.com> Date: Wed, 30 Mar 2016 01:46:00 -0000 Message-ID: Subject: Re: Preventing preemption of 'protected' symbols in GNU ld 2.26 From: Cary Coutant To: "H.J. Lu" Cc: Joe Groff , Alan Modra , Binutils Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00407.txt.bz2 >> However, protected doesn't work this way in older binutils, or with alte= rnative tools like llvm or gold, and it sounds like protected was never int= ended to work this way either. Rather If gcc is interested in pursuing this= optimization, it seems more responsible to me they could investigate intro= ducing language-level annotations that let libraries opt into the optimizat= ion, instead of unilaterally breaking things for other binutils clients and= introducing new complexity to get back to the original behavior. >> > > Protected symbol never worked correctly on x86 before. My > change closed a few long-standing bugs. There is no going-back. You keep countering my arguments with assertions like, "it was a bug and I fixed it," but you present no arguments of your own to support your position. I'm not sure what long-standing bugs you're referring to -- the only one I can find, PR target/65248 [1], was filed by you yourself, so you can't really use that as support. In fact, PR ld/15228 [2], was filed against ld for *not* refusing to make a COPY relocation to a protected symbol, and Alan fixed that. Gold has the same bug, and I intend to fix it there, too. You have effectively made protected symbols "work" by disabling the very thing they were designed to do. I don't know how to point out the absurdity any more clearly. By your logic, you should make GCC generate PIC code by default and turn -fno-pic into a no-op, because non-PIC code doesn't "work" in a shared library. (Ironically, that would actually make protected symbols work again without your changes.) Over the years, I've heard many complaints from developers that they couldn't put code into a shared library without compiling it with a special option. When you first heard that complaint, why wasn't your response to change the compiler? Isn't that the only way to make shared libraries "work"? -cary [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D65248 [2] https://sourceware.org/bugzilla/show_bug.cgi?id=3D15228