From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id 3A8F0386F022 for ; Thu, 7 Jan 2021 12:51:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3A8F0386F022 Received: by mail-ot1-x32b.google.com with SMTP id a109so6167589otc.1 for ; Thu, 07 Jan 2021 04:51:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=41UAvi4nBuRfg/3fjBClVXrltrzONCMADkBwB0qAviw=; b=rBU6i624tRUUO0q2Iu4paZOS6vNQOXok+TycxqnZMEsaq4b89x92idNm6AR9grXil6 ZyuWGg4YecZ+Ccyz8htGb+2AUNNVTIehP0OSAbLPLMB1D03vTrj6qlnqA+DbrZPZDlA6 QzIRUXzD5urLqrIkVpu7vHgc6Q9KQnoksTO1/si9v0pkykOiE7e0kiufklhJDXSqsGT/ 6JffQEmfNno3zi1SO6VroOheCljp7uG0dHQJSA6PRQHTTTLInkxw1QBeSRQQ7kGAoshj 57JatruZkGBBQOqUngYNihFfl5awaQGkmZEdo6wCEvnO2P2UAcX77wXQWdASwkdfEKwZ 57pw== X-Gm-Message-State: AOAM532JPTeo9ZpcJq9eC08vXy6R6geinRIKx1IeD5vKMtrWCGdwOhw9 d0YTMnpCqF4xwh0+tOuGeguzN8AxhoXvvePC93wO2DavMK4= X-Google-Smtp-Source: ABdhPJw6PIDQK/GPNXal/LY1plPS+J7eHtErqkU6RxAydleojILZ3Nijo4pxCNsSn7kls+b6kcM/b3/dL2LC8NdVUoo= X-Received: by 2002:a05:6830:1d71:: with SMTP id l17mr6491754oti.269.1610023907737; Thu, 07 Jan 2021 04:51:47 -0800 (PST) MIME-Version: 1.0 References: <1bfa01e6e92073b30c02cb76a209656b9d97b675.1610016590.git.szabolcs.nagy@arm.com> <6b00243a-dee5-83c5-411b-0ec987e9a877@redhat.com> In-Reply-To: <6b00243a-dee5-83c5-411b-0ec987e9a877@redhat.com> From: "H.J. Lu" Date: Thu, 7 Jan 2021 04:51:11 -0800 Message-ID: Subject: Re: [PATCH 3/3] csu: Move static pie self relocation later [BZ #27072] To: "Carlos O'Donell" Cc: Szabolcs Nagy , GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3030.8 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 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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, 07 Jan 2021 12:51:49 -0000 On Thu, Jan 7, 2021 at 4:46 AM Carlos O'Donell wrote: > > On 1/7/21 7:36 AM, H.J. Lu via Libc-alpha wrote: > > On Thu, Jan 7, 2021 at 3:04 AM Szabolcs Nagy via Libc-alpha > > wrote: > >> > >> On targets where hidden symbol access does not need RELATIVE > >> relocs, move the static pie self relocation after tunables and > >> cpu features are set up. This allows processing IRELATIVE > >> relocs with correct ifunc dispatch logic. > >> > >> Unfortunately it is hard to guarantee that there will be no > >> dynamic relocations in the early start up code, so this is a > >> bit fragile. Ideally the RELATIVE relocs would be processed as > >> early as possible and IRELATIVE relocs after cpu features are > >> setup, but in glibc it is hard to separate them into two steps. > > > > x86 linker places IRELATIVE relocations the last: > > > > https://sourceware.org/bugzilla/show_bug.cgi?id=13302 > > > > Does your linker have this bug fixed? > > Agreed, this is something I asked about during the design of > IFUNCs and I was told by Ulrich and others that IRELATIVE has > to be placed in a group and after RELATIVE relocs. Not just before RELATIVE. IRELATIVE should be processed the last before all other relocations. See PR 13302 for other cases. -- H.J.