From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by sourceware.org (Postfix) with ESMTPS id 5F6BE3858D3C for ; Thu, 14 Apr 2022 01:16:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5F6BE3858D3C Received: by mail-pl1-x62e.google.com with SMTP id c23so3465572plo.0 for ; Wed, 13 Apr 2022 18:16:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=mMSMfyX4/konR6Il5fv1zYwhNIfKNPP8o+dhZF2e/Xc=; b=OwcEpoqN9uYA53wQiYBmgBHrpB9ByPGjOK5Bqwzsbm+s2G6ccX5dM1xEctwe+GmUFK lViJcU/6HfOajxUxfxV3Qe/GgqF5fHkvYK1wFY3XhI2Erhgm0+OVoSsk3u1LKdYtQU4g QcS0uCUR6EL5r2Ys9FDVWMgeOCWk3YnMF5ZenNimUcFMD8oGeHO/SvFKA2nk0s4EBqSc +VxItSfK0pyMYFrEWwqitqPBN/8MKBGjEBBFkNk6bI27TxTu6GUxML1s3+qnb/IIAPvl HMK2yoWR4O/aMBNLWyrowXd6TiZ6JCQQ68e0Mc+d9AM7ba4I6ko/pOJsAnrStty1dF4F 7apQ== X-Gm-Message-State: AOAM532BQptb6BlyCFrJ4zinPyUnUi7CAhRJHGCiZHoYcHFtFmC9mCOE T195RSUaP/bCYmBb/1nl7k7wukWmlJc= X-Google-Smtp-Source: ABdhPJzBpq5s/KHY7i9ozqcvYX7KqEDBHUAD4zIqZDZUK5QsJHTngZ/NmMA/7o4Cs6xvbeVipFxjyA== X-Received: by 2002:a17:90a:cd06:b0:1cb:8c74:2baf with SMTP id d6-20020a17090acd0600b001cb8c742bafmr1609465pju.214.1649898978296; Wed, 13 Apr 2022 18:16:18 -0700 (PDT) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id k20-20020aa788d4000000b004fb07f819c1sm307426pff.50.2022.04.13.18.16.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Apr 2022 18:16:17 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 96C191142F9D; Thu, 14 Apr 2022 10:46:14 +0930 (ACST) Date: Thu, 14 Apr 2022 10:46:14 +0930 From: Alan Modra To: Tulio Magno Quites Machado Filho Cc: libc-alpha@sourceware.org Subject: Re: [PATCH v2 4/4] powerpc64: Enable static-pie Message-ID: References: <20220228064052.3413334-1-amodra@gmail.com> <20220228064052.3413334-5-amodra@gmail.com> <87wnfz199a.fsf@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wnfz199a.fsf@linux.ibm.com> X-Spam-Status: No, score=-3031.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2022 01:16:22 -0000 On Fri, Apr 08, 2022 at 07:49:05PM -0300, Tulio Magno Quites Machado Filho wrote: > Alan Modra via Libc-alpha writes: > > > * sysdeps/powerpc/powerpc64/configure.ac (SUPPORT_STATIC_PIE): Define. > > (PI_STATIC_AND_HIDDEN): Define. > > * sysdeps/powerpc/powerpc64/configure: Regenerate. > > While the code in this patch is perfect, I'm slightly inclined to think its > merge should be delayed until the failures on both powerpc64-linux and > powerpc64le-linux are fixed. > > Another option would be to restrict this code to powerpc64le-linux only, > although I haven't had the success you mentioned in the cover letter. > > Anyway, in one of my tests in particular (powerpc64le-linux, GCC 8, Binutils > 2.30, without --enable-static-pie) I noticed many tests failing. I'm still > investigating what happened. binutils-2.30 is too old. You'll find __rela_iplt_start and __rela_iplt_end symbols being defined in PIEs. Those symbols are supposed to mark out IFUNC relocs in ET_EXEC static binaries. Their presence in ET_DYN static binaries is bad, especially since it seems they have garbage values not pointing at the correct set of relocations. I suspect, but haven't checked, that the garbage values are due to -z combreloc. This bug in ld was fixed with commit 795e3bb7de9, so you'll need at least binutils-2.33 for static-pie. I'll note that static-pie is enabled in glibc without any user --enable-static-pie, ie. it is the default if SUPPORT_STATIC_PIE is set. SUPPORT_STATIC_PIE is enabled unconditionally for x86 and aarch64 without any toolchain checks, and I foolishly followed that precedent. Likely x86 would fail the glibc testsuite all over the place with an old binutils too. -- Alan Modra Australia Development Lab, IBM