From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by sourceware.org (Postfix) with ESMTPS id B70273858C53 for ; Thu, 14 Apr 2022 03:42:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B70273858C53 Received: by mail-pj1-x1035.google.com with SMTP id a16-20020a17090a6d9000b001c7d6c1bb13so4462517pjk.4 for ; Wed, 13 Apr 2022 20:42:37 -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=iMiKeivWIvcXntTHH3PTNOQUfGTVgZeLwLqsbV+ty2w=; b=4ONo+3K+gt/boEIpETu3RrwV2T/h1LSAf0P+EEcrslY27vA8Bj1ltnfIi4qeoAlgOV 9ZMmWIsBE2K/LwJxAsUXreIYgZFgUdQpeSMsOa8yToKxMH76jQO1aP55M0P9D6yW8tEh XvTGw+gSo3LzFLqWPEY0V2EBo4hil1Twf5dEjvfJGb252OU3zUsixv0s3vDe+71e4qLb 9fTrvleEmAGDT5FGybqWqhPUmrAXDDT0aVfrok92DhxGyDP0dJrETPDT3Ey1f3KImUjT 8/nC1FPpQN/XErUHN4wdmFWaHjL9vWBIWiKWLgs0haNj3YO2vG6SHC7pFHTymb5yXcrm 0R8Q== X-Gm-Message-State: AOAM532VyqWKe7OKAZZnbeF6gBYzCfdHIAF0LeW+BfWDG1xzQZRjoNXd wQOlMOlh2rUA96NaUNDmaQx+Zg== X-Google-Smtp-Source: ABdhPJzHHAHeXJ6rktXs/JU2pjVjd1PYGLLQr95z4/jFxyjFRbBLCGeEplssKaOFSLeV3Feq6pc5oQ== X-Received: by 2002:a17:90b:4d08:b0:1c7:7567:9f6b with SMTP id mw8-20020a17090b4d0800b001c775679f6bmr2172986pjb.134.1649907756617; Wed, 13 Apr 2022 20:42:36 -0700 (PDT) Received: from google.com ([2620:15c:2ce:200:93b2:d39f:36ee:5bcf]) by smtp.gmail.com with ESMTPSA id d21-20020a056a0024d500b004fb0e7c7c3bsm514253pfv.161.2022.04.13.20.42.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Apr 2022 20:42:35 -0700 (PDT) Date: Wed, 13 Apr 2022 20:42:32 -0700 From: Fangrui Song To: Alan Modra Cc: Tulio Magno Quites Machado Filho , libc-alpha@sourceware.org Subject: Re: [PATCH v2 4/4] powerpc64: Enable static-pie Message-ID: <20220414034232.5doo4s2l7nz3kjyn@google.com> 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; format=flowed Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-20.9 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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 03:42:43 -0000 On 2022-04-14, Alan Modra via Libc-alpha wrote: >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 think conditional definition of __rela_iplt_start depending on -no-pie/-pie is inelegant: it makes __rela_iplt_start the only symbol with -no-pie/-pie internal linker script difference. -no-pie/-pie internal linker scripts could otherwise be very similar, with just the image base difference.