From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34398 invoked by alias); 24 Mar 2016 00:00:48 -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 34259 invoked by uid 89); 24 Mar 2016 00:00:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=browse, preventing, intentional, joe X-HELO: mail-in2.apple.com Received: from mail-out2.apple.com (HELO mail-in2.apple.com) (17.151.62.25) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 24 Mar 2016 00:00:29 +0000 Received: from relay3.apple.com (relay3.apple.com [17.128.113.83]) by mail-in2.apple.com (Apple Secure Mail Relay) with SMTP id E7.85.06427.B1E23F65; Wed, 23 Mar 2016 17:00:27 -0700 (PDT) Received: from nwk-mmpp-sz08.apple.com (nwk-mmpp-sz08.apple.com [17.128.115.25]) (using TLS with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by relay3.apple.com (Apple SCV relay) with SMTP id 3D.EB.12923.B1E23F65; Wed, 23 Mar 2016 17:00:27 -0700 (PDT) Received: from [17.153.39.148] by nwk-mmpp-sz08.apple.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Mar 31 2015)) with ESMTPSA id <0O4I00KVQO0P7W10@nwk-mmpp-sz08.apple.com> for binutils@sourceware.org; Wed, 23 Mar 2016 17:00:27 -0700 (PDT) From: Joe Groff Content-type: text/plain; charset=us-ascii Content-transfer-encoding: quoted-printable Subject: Preventing preemption of 'protected' symbols in GNU ld 2.26 Message-id: <9106B2FB-BB06-413A-A04D-EEFB992784FA@apple.com> Date: Thu, 24 Mar 2016 00:00:00 -0000 To: binutils@sourceware.org MIME-version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00312.txt.bz2 Hi everyone. On the Swift project, we're getting bug reports that people ar= e no longer able to link Swift programs using binutils 2.26: https://bugs.swift.org/browse/SR-1023 This appears to be due to an intentional behavior change in commit https://= sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;a=3Dcommit;h=3Dca3fe95e4= 69b9daec153caa2c90665f5daaec2b5, to allow protected symbols to be the targe= ts of copy relocations. This breaks our intended use of "protected" in Swif= t, where we really want to be able to assume that the relative addresses of= our symbols within a single executable or .so won't be preempted or moved.= This lets us emit position-independent constant reflection metadata that d= oesn't need load-time relocations, saving us some startup time and dirty pa= ges. I wanted to know if there's a supported way to express to the linker t= hat "this symbol is protected, and also can never be copied". I'd like to a= void globally setting -Bsymbolic since I wouldn't want to impact non-Swift = .o files in a mixed-language project. AIUI, -Bsymbolic also wouldn't preven= t object files from trying to use copy relocations to our symbols and break= ing our assumptions about their address; I'd like to know if it's possible = to prevent that too. Thanks for any help you can give! -Joe