From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id A9EFA393AC3D; Mon, 21 Jun 2021 14:36:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A9EFA393AC3D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id C192F1FD2F; Mon, 21 Jun 2021 14:35:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1624286159; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yhpAS67JFXDffRCGC/WpZ5MQNJDE3m+vKjiMFB5sQog=; b=UPBKNanHnGqaxJu0UGKhjewppYfiwF4y6+ldb/4nBlZ9FgvMoGG3KYpasndx2mb5FB12Ee OCbsFsfi7bjtZeph8FRorHdt0ZyKwafn4BE++FhQeOnPskX9c1PISzDuyQUMYT6/80oG3a 8COPNkryeYwUqgC9NEV6NjQgWmX7/Jg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1624286159; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yhpAS67JFXDffRCGC/WpZ5MQNJDE3m+vKjiMFB5sQog=; b=ycQcnp172T2g5rU7MbG1/goF9B3SZHiAxNmCMHvlcjpdH0t7ZNcsTnMlQBhfcdeSpYTLmg 0LiEob8WCtjkF0Dg== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id E006EA3BAE; Mon, 21 Jun 2021 14:35:58 +0000 (UTC) Received: by wotan.suse.de (Postfix, from userid 10510) id D7AE16361; Mon, 21 Jun 2021 14:35:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by wotan.suse.de (Postfix) with ESMTP id D63EF62F1; Mon, 21 Jun 2021 14:35:58 +0000 (UTC) Date: Mon, 21 Jun 2021 14:35:58 +0000 (UTC) From: Michael Matz To: "H.J. Lu" cc: =?UTF-8?Q?F=C4=81ng-ru=C3=AC_S=C3=B2ng?= , llvm-dev@lists.llvm.org, GCC Development , GNU C Library , GNU gABI gnu-gabi , Binutils Subject: Re: [llvm-dev] RFC: Add GNU_PROPERTY_UINT32_AND_XXX/GNU_PROPERTY_UINT32_OR_XXX In-Reply-To: Message-ID: References: <20210617193825.zzjyoybttajksw5x@google.com> <20210618000600.c7yh6twgbukmyouj@google.com> User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-ID: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; CHARSET=UTF-8 Content-Transfer-Encoding: 8BIT X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gnu-gabi@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gnu-gabi mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2021 14:36:02 -0000 Hello, On Thu, 17 Jun 2021, H.J. Lu via Gcc wrote: > > > • Disallow copy relocation against definition with the STV_PROTECTED > > > visibility in the shared library with the marker. > > > > If this is for GNU ld x86 only, I'm fine with it:) > > > > gold and ld.lld just emit an error unconditionally. I think non-x86 > > GNU ld ports which never support "copy relocations on protected data > > symbols" may want to make the diagnostic unconditional as well. > > Well, while (Michael Matz and ) I think compatibility check for "copy > > relocations on protected data symbols" is over-engineering (and > > Alan/Cary think it was a mistake), if you still want to add it, it is > > fine for me... > > For Clang, I hope we will not emit such a property, because Clang > > never supports the "copy relocations on protected data symbols" > > scheme. > > The issue is that libfoo.so used in link-time can be different from > libfoo.so at run-time. The symbol, foobar, in libfoo.so at link-time > has the default visibility. But foobar in libfoo.so at run-time can be > protected. ld.so should detect such cases which can lead to run-time > failures. Yes, but I think we can _unconditionally_ give an error in this case, even without a marker. I view restricting visiblity of a symbol in furture versions of shared libraries to be an ABI change, hence it has to be something that either requires a soname bump or at the very least symbol versioning with the old version staying on default visibility. Compare the situation to one where the old libfoo.so provided a symbol bar, and the new one doesn't (sort of very restricted visiblity). ld.so will unconditionally give an error. I don't see this situation materially different from bar's visibility be changed from default to protected. > > I think this can be unconditional, because the "pointer equality for > > STV_PROTECTED function address in -shared" case hasn't been working > > for GNU ld for at least 20 years... Many ports don't even produce a > > dynamic relocation. > > True. But see above. You may not care about such use cases. But I > believe that ld.so should not knowingly and silently allow such run-time > failure to happen. Agreed, but giving an error message unconditionally wouldn't be silent. Ciao, Michael.