From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id 087C9383F857 for ; Tue, 19 Jan 2021 17:54:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 087C9383F857 Received: by mail-ot1-x333.google.com with SMTP id d1so115196otl.13 for ; Tue, 19 Jan 2021 09:54:29 -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=VFnwMnb2wvByXvuFAVyBes4XfXDS3yv2LuIl0NM++eU=; b=IcIbbnQ1DmWHSDv6clESh7McWonO+DlUU1eUIZLx5UAkx07agF/Nz6U8pQrjcl53Ur /mT8J1huhxbq2dS7pjhe5IMHaQ0G7m266ygSLkNkpMzmuYIcn39gIrRasXPLju39AHhf +TNfOgVYVSERL4zTeJVmx7duce8J9ecPYhLXmt/im6mW4x4JL08uRkjBEZK/pEre7Wwz sdiarkCDdVgVzcvGBbAB/wKxzXWJvbmrmFf7OS5dmdKQRqyVYOlstUX9EAnMkIGhxeTj wlatg1TuOsSLlKMECIAqdmzDTaU47y0OULgGSMpXD0km78qTHTANqqkoUC/L2VVymRDg O0nw== X-Gm-Message-State: AOAM533U1iGKqsb/Y4gkrXsk2sXtPla/tRePG+Zrp80aB/0u58o8pDcs pEBD7wsL8kO34bZ2Q4IdSKo5C1SWuGuTl6kByOE= X-Google-Smtp-Source: ABdhPJw15Vwxm8uaxOeYDabJN9IEl+2mNJoB+/MO0LfBFb9gC1cQVskHzlMTejjbiGaKUvLI8QBWTJT0SYERKnyBM3Y= X-Received: by 2002:a9d:6285:: with SMTP id x5mr4260381otk.179.1611078868501; Tue, 19 Jan 2021 09:54:28 -0800 (PST) MIME-Version: 1.0 References: <20210119143500.GA3445@arm.com> <20210119152441.GB3445@arm.com> <20210119170319.GC3445@arm.com> <20210119173832.GD3445@arm.com> <20210119174734.GE3445@arm.com> In-Reply-To: <20210119174734.GE3445@arm.com> From: "H.J. Lu" Date: Tue, 19 Jan 2021 09:53:52 -0800 Message-ID: Subject: Re: [PATCH v4 08/10] csu: Move static pie self relocation later [BZ #27072] To: Szabolcs Nagy Cc: =?UTF-8?B?RsSBbmctcnXDrCBTw7JuZw==?= , Adhemerval Zanella , GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3030.3 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: Tue, 19 Jan 2021 17:54:30 -0000 On Tue, Jan 19, 2021 at 9:47 AM Szabolcs Nagy wrote: > > The 01/19/2021 09:42, H.J. Lu wrote: > > On Tue, Jan 19, 2021 at 9:38 AM Szabolcs Nagy wrote: > > > > > > The 01/19/2021 09:10, H.J. Lu wrote: > > > > On Tue, Jan 19, 2021 at 9:03 AM Szabolcs Nagy wrote: > > > > > > > > > > The 01/19/2021 08:47, H.J. Lu wrote: > > > > > > On Tue, Jan 19, 2021 at 7:32 AM H.J. Lu wrote: > > > > > > > On Tue, Jan 19, 2021 at 7:24 AM Szabolcs Nagy wrote: > > > > > > > > The 01/19/2021 06:48, H.J. Lu wrote: > > > > > > > > > On Tue, Jan 19, 2021 at 6:37 AM Adhemerval Zanella via Libc-alpha > > > > > > > > > wrote: > > > > > > > > > > On 19/01/2021 11:35, Szabolcs Nagy wrote: > > > > > > > > > > > the problem is that _dl_phdr is used in ARCH_SETUP_TLS > > > > > > > > > > > (to get the tls program headers) so the __ehdr_start > > > > > > > > > > > magic should be before that (this only matters if auxv > > > > > > > > > > > lacks AT_PHDR for some reason, which should not happen > > > > > > > > > > > normally on linux, so testing won't show the problem) > > > > > > > > > > > > > > > > > > > > By normally do you mean it might happen on a specific kernel version > > > > > > > > > > or is it architecture specific? > > > > > > > > > > > > > > > > i guess __ehdr_start symbol can be useful and with it > > > > > > > > glibc does not have to depend on auxv (which an elf > > > > > > > > loader like valgrind/qemu-user may get wrong) > > > > > > > > > > > > > > > > however it is only used as a fallback and on linux > > > > > > > > AT_PHDR is always expected to be present. (i don't > > > > > > > > know if this ever triggers) > > > > > > > > > > > > > > Only used on Hurd? > > > > > > > > > > > > Does arm64 linker always define __ehdr_start? If yes, can you drop > > > > > > "weak," to see if RELATIVE goes away? > > > > > > > > > > __ehdr_start support was added in binutils 2.23 > > > > > > > > We may assume binutils >= 2.33 when building for static PIE > > > > since all static PIE linkers should define __ehdr_start. > > > > > > this piece of code is used for both static PIE and non-PIE, > > > but we already require binutils >= 2.25 for building glibc, > > > dropping weak should be fine. > > > > > > > It is safer to check BUILD_PIE_DEFAULT when dropping > > weak. > > ok. > > does static linking have weaker linker version requirement > than building glibc? Very unlikely. But one may be forced to use the older linker for some reason. -- H.J.