From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 94863 invoked by alias); 10 Aug 2015 11:04:52 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 94847 invoked by uid 89); 10 Aug 2015 11:04:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 10 Aug 2015 11:04:50 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-23-j6Ic_tyPTQ2hzwelDxzSeQ-1; Mon, 10 Aug 2015 12:04:45 +0100 Received: from [10.2.206.40] ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 10 Aug 2015 12:04:45 +0100 Message-ID: <55C8854D.5060609@arm.com> Date: Mon, 10 Aug 2015 11:04:00 -0000 From: Szabolcs Nagy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Marcus Shawcroft , Ramana Radhakrishnan , Andreas Krebbel , "H.J. Lu" Subject: Re: [PATCH] Fix default_binds_local_p_2 for extern protected data References: <55AFCC7C.8010105@arm.com> In-Reply-To: <55AFCC7C.8010105@arm.com> X-MC-Unique: j6Ic_tyPTQ2hzwelDxzSeQ-1 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00447.txt.bz2 ping. On 22/07/15 18:01, Szabolcs Nagy wrote: > The commit > https://gcc.gnu.org/viewcvs/gcc?view=3Drevision&revision=3D222184 > changed a true to false in varasm.c: > > bool > default_binds_local_p_2 (const_tree exp) > { > - return default_binds_local_p_3 (exp, flag_shlib !=3D 0, true, true); > + return default_binds_local_p_3 (exp, flag_shlib !=3D 0, true, false, > + !flag_pic); > } > > where > > default_binds_local_p_3 (const_tree exp, bool shlib, bool weak_dominate, > - bool extern_protected_data) > + bool extern_protected_data, bool common_local_p) > { > > false means that extern protected data binds locally, > which is wrong if the target can have copy relocations > against it (then the address must be loaded from GOT > otherwise the main executable will see different address). > > Currently S/390, ARM and AArch64 targets use this predicate > and the current default is wrong for all of them (they can > have copy relocs) so I changed the default instead of doing > it in a target specific way. > > The equivalent x86_64 bug was > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D65248 > the default was changed for > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D65780 > now i opened > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D66912 > for arm and aarch64. > > Needs a further binutils patch too to emit R_*_GLOB_DAT > instead of R_*_RELATIVE relocs for protected data. > The glibc elf/tst-protected1a and elf/tst-protected1b > tests depend on this. > > Tested ARM and AArch64 targets. > > gcc/ChangeLog: > > 2015-07-22 Szabolcs Nagy > > PR target/66912 > * varasm.c (default_binds_local_p_2): Turn on extern_protected_data. > > gcc/testsuite/ChangeLog: > > 2015-07-22 Szabolcs Nagy > > PR target/66912 > * gcc.target/aarch64/pr66912.c: New. > * gcc.target/arm/pr66912.c: New. >