From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 4E1F21F8C6 for ; Tue, 13 Jul 2021 23:32:10 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 37B813898522 for ; Tue, 13 Jul 2021 23:32:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 37B813898522 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1626219129; bh=kNuG7+UK8HcYtpTY+J8zQ8X43fZbHzEt0su1rL3jIPo=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=n8qxQ2IFvZ4zNslRBUBPxPrJYQhV9qtibtJy/k/mQJqTYiEEi1T8HUBAQjS5gWj9W cdYEgruUnJjHwkX0dOarcmRiJpmhFOFkUd87n4pcKzEh5GCtb7Qo3h4Ddx+wy4g+nN qfG9VI1VJ3FN6PXSyXG2+mTtclqOAKG+Esb8a/io= Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by sourceware.org (Postfix) with ESMTPS id BD1103858C3B for ; Tue, 13 Jul 2021 23:31:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BD1103858C3B Received: by mail-yb1-xb31.google.com with SMTP id p22so116416yba.7 for ; Tue, 13 Jul 2021 16:31:49 -0700 (PDT) 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=kNuG7+UK8HcYtpTY+J8zQ8X43fZbHzEt0su1rL3jIPo=; b=MKVBV3qd8M16fM14IJWtuqxtqTsm+E8PLvYvij9/R61bH13c9PDaXQc6Z5IE+1l3En BUxfW7P565E1j1XihoVvLlvxLzaPrs47IymmDfysS5JKPtEU4uXTmbcgzjnVbul0TSs6 9CccoQKRg6prleyEU1bSe2SY1kSAxaT7kdIJuD+G/NqK/whcZRQxCcS98JbfUmzMtBva XTEmUKt1EjAQ6v6+5MH2y5NmdczXMytjj7tbJUHq5YI4lz0EASegGJVEtNR+8F3qJ+Gt D+uvQYREnN4gK51P5dPWEg5zybZMuqsmy9tPzh/fNz6NKbTCN3pmcVr/0Cplns29LXno WcQw== X-Gm-Message-State: AOAM533H9MNQ/gVHqB1Oqs4hLh1uvDq9+O/rMwIby+Mc7tPMxc6Kjby5 EoPgVnX9xLFvYaTYVkq9t0bMM0hefvrxqTftMvTeJQ== X-Google-Smtp-Source: ABdhPJyb4CqGTTkz/c27KMjpqFSp7eh/eTGxobtWEbcOY79W/s34PfkYGUPHrdTD4O+xdXHHYcKMt5NshSye6yoq40M= X-Received: by 2002:a25:1e57:: with SMTP id e84mr9440423ybe.308.1626219109168; Tue, 13 Jul 2021 16:31:49 -0700 (PDT) MIME-Version: 1.0 References: <20210708221032.955550-1-maskray@google.com> <8b8fb5c9-ce4e-b10e-95b1-0281f96894c0@redhat.com> <20210713080646.3n3ycmh3p4d7ul3t@google.com> <11b630ce-8d50-ee07-37e9-b5fec16a6f18@gotplt.org> <20210713230639.mkyiijn6v7tlo7fc@google.com> In-Reply-To: Date: Tue, 13 Jul 2021 16:31:37 -0700 Message-ID: Subject: Re: [PATCH] csu: Skip ARCH_SETUP_IREL if _dl_relocate_static_pie applied IRELATIVE relocations [BZ #27164] To: "H.J. Lu" Content-Type: text/plain; charset="UTF-8" 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: , From: =?utf-8?q?F=C4=81ng-ru=C3=AC_S=C3=B2ng_via_Libc-alpha?= Reply-To: =?UTF-8?B?RsSBbmctcnXDrCBTw7JuZw==?= Cc: GNU C Library Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On Tue, Jul 13, 2021 at 4:21 PM H.J. Lu wrote: > > On Tue, Jul 13, 2021 at 4:07 PM Fangrui Song via Libc-alpha > wrote: > > > > On 2021-07-13, Siddhesh Poyarekar wrote: > > >On 7/13/21 1:36 PM, Fangrui Song via Libc-alpha wrote: > > >>A toolchain project can do some workaround for a libc if this choice > > >>makes a large community happy. However, I think it is important not to > > >>take it granted. It is inadequate to just dismiss toolchain developers' > > >>reasonable complaints. The libc should actively fix the issues so that > > >>the toolchain will not need to bear unneeded code in the future. > > >> > > >>I actually have contributed quite a few lld/ELF patches to work around > > >>glibc. For this one I just feel it is not right to just patch lld/ELF > > >>without fixing glibc. > > > > > >What's the utility of having the __rela_iplt{_start,_end} symbols in > > >all binaries other than, maybe, simplifying the static linker > > >implementation? How does it improve things for the generated > > >application code in the end? AFAICT it is doing the opposite by > > >requiring application startup to add a conditional to work around the > > >presence of a redundant symbol. > > > > > >Siddhesh > > > > Please see the sentence from the first message > > "In addition, this enables a future simplification to GNU ld: we can > > drop a linker script difference between -no-pie and -pie." > > Did you mean non-PIE static and PIE static? Neither PIE nor PDE > define __rela_iplt{_start,_end}. > > > This is the only difference other than image base difference. > > There are many differences between non-PIE static and PIE static. > Non-PIE static doesn't have DT_XXX sections. % diff -U1 =(ld.bfd --verbose) =(ld.bfd -pie --verbose) --- /tmp/zshEtZMxJ 2021-07-13 16:30:50.228732445 -0700 +++ /tmp/zshNM1wJL 2021-07-13 16:30:50.232732450 -0700 @@ -12,3 +12,3 @@ ================================================== -/* Script for -z combreloc -z separate-code */ +/* Script for -pie -z combreloc -z separate-code */ /* Copyright (C) 2014-2020 Free Software Foundation, Inc. @@ -24,3 +24,3 @@ { - PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000)); . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS; + PROVIDE (__executable_start = SEGMENT_START("text-segment", 0)); . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS; .interp : { *(.interp) } @@ -55,5 +55,3 @@ *(.rela.plt) - PROVIDE_HIDDEN (__rela_iplt_start = .); *(.rela.iplt) - PROVIDE_HIDDEN (__rela_iplt_end = .); }