From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by sourceware.org (Postfix) with ESMTPS id BA4E2387084B for ; Tue, 19 Jan 2021 17:11:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BA4E2387084B Received: by mail-oi1-x229.google.com with SMTP id 9so21938488oiq.3 for ; Tue, 19 Jan 2021 09:11:09 -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=GKmxnMfaDeLqg5RyyvDoXexoI+kTQS5A1PjCkyzXUwo=; b=MdSK4jXWl9UyV2mvXIFiEcYo59xcLZYEPy/VNn0DkvJGrYDWljctpy8m3qVvFNn3Y3 cFJXrXk1u6wXFPuPzOClpE2njhHABB4b/ydAXk9+TzxwwW0FuHonjbK5hyqqjEI6ncCt t/4KaxXIHYo2pEALbeuUcLuEi/XbAmev7D4u2ZsPGCZjRJZKCaawynACqtoqjDSaBnpE iJ/NVyR12g4swzxw0gQjvicM8DS/3QNVMV3ZG0RIolFLC+K7l8lL6bSMI8Y0dEJO+nSW p/83oue8oiitbiEOQuY0S24o/H332A/FoKk8GqCe4mn1Jz0FoblAJUKedX9oF3a2wQH7 nD1g== X-Gm-Message-State: AOAM533jAbGDyk1arel3TZXIh3unYl0+MrMdgFg+L+vJOZSN0kmxTL1k qOAQzk2ZPDYjKDUvMLbk4gBerXWwQur4hZkPE3A= X-Google-Smtp-Source: ABdhPJyQ6tz7TiOSgEaxu01SRKgULLTceI/MiZZac+fPWQgShWFL/wuBHOzI3YW7LVW4cVWzzVpNRj5/8iF7Tvs9m0o= X-Received: by 2002:aca:c693:: with SMTP id w141mr441186oif.58.1611076269163; Tue, 19 Jan 2021 09:11:09 -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: <20210119170319.GC3445@arm.com> From: "H.J. Lu" Date: Tue, 19 Jan 2021 09:10:33 -0800 Message-ID: Subject: Re: [PATCH v4 08/10] csu: Move static pie self relocation later [BZ #27072] To: Szabolcs Nagy , =?UTF-8?B?RsSBbmctcnXDrCBTw7JuZw==?= Cc: Adhemerval Zanella , GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3030.0 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:11:11 -0000 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. Does lld define __ehdr_start? > 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.