From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29684 invoked by alias); 4 Feb 2015 22:47:36 -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 29666 invoked by uid 89); 4 Feb 2015 22:47:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_STOCKGEN,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-wg0-f54.google.com Received: from mail-wg0-f54.google.com (HELO mail-wg0-f54.google.com) (74.125.82.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 04 Feb 2015 22:47:33 +0000 Received: by mail-wg0-f54.google.com with SMTP id b13so4391246wgh.13 for ; Wed, 04 Feb 2015 14:47:30 -0800 (PST) X-Received: by 10.180.10.131 with SMTP id i3mr9409193wib.54.1423090050673; Wed, 04 Feb 2015 14:47:30 -0800 (PST) Received: from [10.37.121.88] (089144219088.atnat0028.highway.a1.net. [89.144.219.88]) by mx.google.com with ESMTPSA id ej10sm27258208wib.1.2015.02.04.14.47.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Feb 2015 14:47:29 -0800 (PST) User-Agent: K-9 Mail for Android In-Reply-To: References: <20150203193615.GZ1746@tucnak.redhat.com> <20150203221935.GA1746@tucnak.redhat.com> <20150204183127.GU1746@tucnak.redhat.com> <20150204184205.GW1746@tucnak.redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: [PATCH x86_64] Optimize access to globals in "-fpie -pie" builds with copy relocations From: Bernhard Reutner-Fischer Date: Wed, 04 Feb 2015 22:47:00 -0000 To: "H.J. Lu" ,Sriraman Tallam CC: Jakub Jelinek ,Uros Bizjak ,"gcc-patches@gcc.gnu.org" ,David Li ,Cary Coutant Message-ID: <50365BC5-5D7C-423A-803B-F8F6F040C865@gmail.com> X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00298.txt.bz2 On February 4, 2015 11:37:01 PM GMT+01:00, "H.J. Lu" wrote: >On Wed, Feb 4, 2015 at 1:53 PM, Sriraman Tallam >wrote: >> On Wed, Feb 4, 2015 at 10:57 AM, H.J. Lu wrote: >>> On Wed, Feb 4, 2015 at 10:51 AM, Sriraman Tallam > wrote: >>>> On Wed, Feb 4, 2015 at 10:45 AM, H.J. Lu >wrote: >>>>> On Wed, Feb 4, 2015 at 10:42 AM, Jakub Jelinek >wrote: >>>>>> On Wed, Feb 04, 2015 at 10:38:48AM -0800, H.J. Lu wrote: >>>>>>> Common symbol should be resolved locally for PIE. >>>>>> >>>>>> binds_local_p yes, binds_to_current_def_p no. >>>>>> >>>>> >>>>> Is SYMBOL_REF_LOCAL_P set to binds_local_p or >>>>> binds_to_current_def_p? >>>> >>>> Looks like binds_local_p: >>>> >>>> varasm.c: >>>> void >>>> default_encode_section_info (tree decl, rtx rtl, int first >ATTRIBUTE_UNUSED) >>>> { >>>> ... >>>> if (targetm.binds_local_p (decl)) >>>> flags |= SYMBOL_FLAG_LOCAL; >>>> >>> >>> Why is SYMBOL_REF_LOCAL_P false? >> >> In varasm.c, default_binds_local_p_1 >> >> >> /* Default visibility weak data can be overridden by a strong symbol >> in another module and so are not local. */ >> else if (DECL_WEAK (exp) >> && !resolved_locally) > ^^^^^^^^^^^^^^^^^^^ >Why is resolved_locally false? It should be true for common >symbol when compiling for PIE. > >> local_p = false; >> >> For weak definition, it is set to false here. Yea and i think this is still wrong and known as http://gcc.gnu.org/PR32219 Thanks