From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by sourceware.org (Postfix) with ESMTPS id C19AC384A031 for ; Tue, 19 Jan 2021 17:34:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C19AC384A031 Received: by mail-oi1-x235.google.com with SMTP id w8so205658oie.2 for ; Tue, 19 Jan 2021 09:34:02 -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:content-transfer-encoding; bh=Edc32j/Ops29h51jHD1GypmCoRO/cEBq2/EqvSaGzjk=; b=UXrQwR0hyznSDlaGqMpQPBz4RWW+t5Cl+9iXPLqwH2sU6mLS+HVChvCqXgAleZxVrq Wb1BMIB9QEGo9JIhP1U3k0e1zTXvmSnvdWKdragxlWHWCPLOsgeu7b7bADydvll8mZFL a6bVey8nwJ+1r8YYzk2ILYRl8F4dv3DQnS/Hfr2gjmsa/tYr29Z5HXOoEQfhOZZVInah mRzsJ8LHaoZoQGMULSMHzgwFofy5X+A7aA9jlZbMbrpWh872Vqb7euSWt8J1/oKRNdlQ AcaRHmrq3D7l4Sea6b9yRQe7OM7H8zcYYkbwfcGjOYEstFCuxA8z35bg7UUnxQ/ysQLF 2pNQ== X-Gm-Message-State: AOAM532C3toOYHTcDzaya5V+HiI5NpsdQKM8xB1UUO3J8jCtJQphfxcq +2QAwynh/BxvklHU/DaHiobssMv9I+dhzxNUf78= X-Google-Smtp-Source: ABdhPJzFkwrRgjCmRdD39/8qtLuOo8SqmHWNnszLmDEdiWAG/bZCG6Fek+rNtYzB+yx9ofRo4izwC8gTbpCxHr3PAjw= X-Received: by 2002:aca:c693:: with SMTP id w141mr516335oif.58.1611077642235; Tue, 19 Jan 2021 09:34:02 -0800 (PST) MIME-Version: 1.0 References: <4224b7c0428492696fe6d6c01739adcf69fc677d.1610986541.git.szabolcs.nagy@arm.com> <1ba70d1b-08f8-6a5d-ecf4-45200744c9d8@linaro.org> <20210119143500.GA3445@arm.com> <20210119152441.GB3445@arm.com> <20210119170319.GC3445@arm.com> In-Reply-To: From: "H.J. Lu" Date: Tue, 19 Jan 2021 09:33:25 -0800 Message-ID: Subject: Re: [PATCH v4 08/10] csu: Move static pie self relocation later [BZ #27072] To: =?UTF-8?B?RsSBbmctcnXDrCBTw7JuZw==?= Cc: Szabolcs Nagy , Adhemerval Zanella , GNU C Library Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3031.2 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:34:13 -0000 On Tue, Jan 19, 2021 at 9:26 AM F=C4=81ng-ru=C3=AC S=C3=B2ng wrote: > > On Tue, Jan 19, 2021 at 9:11 AM H.J. Lu wrote: > > > > On Tue, Jan 19, 2021 at 9:03 AM Szabolcs Nagy w= rote: > > > > > > 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-a= lpha > > > > > > > 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 kerne= l 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 >=3D 2.33 when building for static PIE > > since all static PIE linkers should define __ehdr_start. > > > > Does lld define __ehdr_start? > > LLD defines __ehdr_start as hidden if it is not a defined symbol in > -no-pie/-pie/-shared modes. > The behavior seems to match gold. GNU ld seems to use STB_LOCAL > STV_DEFAULT but the exterior behavior should be the same. I am not sure where you got such incorrect info. Both ld and gold were cha= nged to STV_HIDDEN in 2013 by the same commit: ommit cde7cb0129a884a060b99c7c83e8f5c9af728b0a Author: Maciej W. Rozycki Date: Fri May 3 15:19:27 2013 +0000 gold/ PR ld/15365 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN. ld/ PR ld/15365 * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Restrict __ehdr_start's export class to no less than STV_HIDDEN= . --=20 H.J.