From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id 58E203851C2B for ; Tue, 19 Jan 2021 17:26:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 58E203851C2B Received: by mail-pg1-x52b.google.com with SMTP id z21so13374790pgj.4 for ; Tue, 19 Jan 2021 09:26:05 -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=ZntNkvSu7Iw8wr9HNcf00HsQe9WAf3R65/5jgJ+X0V0=; b=OwVgg4dAnbx4o4inzgXPmhBmyUrfiZAgOC/NuYbug7ehe13esBLSsHLiAIT1xQZ53T I1CWjuT2S4K6ID0Qjda6PRgaxKq2pr8QjCJ9zI3XKq2QSBE5m4bpsgi/xIy9F3hrpJfQ ByOhlLSb+nf3sZB+BA8rmoaBtxs0JI4Ux76pb/kCIkO8mU8pdPouOQ1Ram/dDL1H7+0W nSyoIIDBJ3XGmkFIgIL2nUAib0HGsOiHB9Ww/c5Ji9/fab0Uuxf95L+Fe27ev509rhwA XgrXqJI/vBGYn0rjui6q56aetqY77ZD2SuojRdN7dJA8K3SYkPohQIPXCx2Z9hvMkgBE fnEw== X-Gm-Message-State: AOAM532+scc2TIK6ipZAVHtjPUaFeWLKRhL6MZn6AS6d6aDtTON6CvUt GA96HRg7WU4XHxRWMpLznzmodr7HzHbtmVRL/aL/qw== X-Google-Smtp-Source: ABdhPJy4vK9AWnO0Db6J9wp26MYtaJ92fFPULmmJlRmw6zpBIMfDErWafORnahKhASdMutSxVK57evpo8M/ix15pCQc= X-Received: by 2002:a65:48cb:: with SMTP id o11mr5198097pgs.121.1611077164353; Tue, 19 Jan 2021 09:26:04 -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: =?UTF-8?B?RsSBbmctcnXDrCBTw7JuZw==?= Date: Tue, 19 Jan 2021 09:25:53 -0800 Message-ID: Subject: Re: [PATCH v4 08/10] csu: Move static pie self relocation later [BZ #27072] To: "H.J. Lu" 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=-18.2 required=5.0 tests=BAYES_00, BODY_8BITS, 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, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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:26:06 -0000 On Tue, Jan 19, 2021 at 9:11 AM H.J. Lu wrote: > > On Tue, Jan 19, 2021 at 9:03 AM Szabolcs Nagy wro= te: > > > > 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-alp= ha > > > > > > 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 >=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. > > so i guess all supported binutils has it which > > means we can make it non-weak indeed. > > > > good idea. > > > > (we can also ignore auxv and rely on __ehdr_start only, > > but for now just making it non-weak should be fine.) > > > > > -- > H.J. --=20 =E5=AE=8B=E6=96=B9=E7=9D=BF