From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 85E2B386EC78 for ; Thu, 7 Jan 2021 12:46:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 85E2B386EC78 Received: from mail-il1-f197.google.com (mail-il1-f197.google.com [209.85.166.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-110-52pS7UAtOgO11YTH_7OWCg-1; Thu, 07 Jan 2021 07:46:10 -0500 X-MC-Unique: 52pS7UAtOgO11YTH_7OWCg-1 Received: by mail-il1-f197.google.com with SMTP id p10so6327035ilo.9 for ; Thu, 07 Jan 2021 04:46:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=dflbZsGA1eaOgfpCNXoJ53DIoP/ll7CYS5Bn7AFwMZg=; b=PnqOVcsFAKYqKVOOxnKQy+sm6RW6gZdcdsgsAzUX0QvCDs9aqv55drh2/1UK29ASMa NYNiA9sNWkJ914XroiDQ/hu0R2gMbTVZjJxKRmH7TZ3zKY9ksplPLRIl/rTlXTNeIL7x F1H0JRxZ2r15yIX4ka7Zjvljpz60X5sz26qQfAkHvLfxEq+vB9OY+I8UC6Aw/N4NJmk8 Jwfs+I32VXk1H62ub9OoUlh+Nvp2YJWZzGfFGXDbzWS04P83JpNwFJRy0y+LLK7Jy2qI 6CSDfCRrwskzW4UXSAUL5zJ2fKxFN7N/eRq+XfVpgApQQX3sx1+TgXIxDzVry+cFmSZt ugxQ== X-Gm-Message-State: AOAM531wi+5oy3dNFxTSPFLhVIrZ4aR0RYEvlv9fFqONHKs1CO9JmJI7 dDeR1FZFAV7nwi8dZkumuMXaXa1nR2DJ7Aew413KMr2hplB8qzZU98SnmPhpdTK2W6M9asBjYZ7 0kkuXZUI5d4cvkfsLk0j4MQUoem4BsR4u4TsMI+DEMcUzkXUpNlfs4diqlDwPxYh606Sr9Q== X-Received: by 2002:a05:6e02:12ce:: with SMTP id i14mr8830018ilm.248.1610023569340; Thu, 07 Jan 2021 04:46:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWhu1M5LLGAEw5g8IvKbOKzsl6gOfO+Fe/m8EJHxeNKeS+3yF9ZF/HT8Pb9+rhmsrS5iLJpg== X-Received: by 2002:a05:6e02:12ce:: with SMTP id i14mr8830000ilm.248.1610023569153; Thu, 07 Jan 2021 04:46:09 -0800 (PST) Received: from [192.168.1.16] (198-84-214-74.cpe.teksavvy.com. [198.84.214.74]) by smtp.gmail.com with ESMTPSA id 62sm3448210ioc.36.2021.01.07.04.46.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Jan 2021 04:46:08 -0800 (PST) Subject: Re: [PATCH 3/3] csu: Move static pie self relocation later [BZ #27072] To: "H.J. Lu" , Szabolcs Nagy Cc: GNU C Library References: <1bfa01e6e92073b30c02cb76a209656b9d97b675.1610016590.git.szabolcs.nagy@arm.com> From: Carlos O'Donell Organization: Red Hat Message-ID: <6b00243a-dee5-83c5-411b-0ec987e9a877@redhat.com> Date: Thu, 7 Jan 2021 07:46:07 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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:46:16 -0000 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. We need to document more of the guarantees and semantics here. -- Cheers, Carlos.