From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) by sourceware.org (Postfix) with ESMTPS id 9CC973857C47 for ; Fri, 29 Oct 2021 18:38:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9CC973857C47 Received: by mail-yb1-xb32.google.com with SMTP id t127so26318067ybf.13 for ; Fri, 29 Oct 2021 11:38:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9YDfdK0sTUngmtHoFCTI5o8lMDcFC2/Xh5r11Dgd4fY=; b=nwQ5GSlAAA2NVlksW8bLyEsAkY5Rzx1SBexiBccsQrpjIYCyxiU+5J9qJ8XlT9xamp qWODXPhfIcUd+NQrh+ffUpOHF1Rx+cIGTRL5IBK/6odv120eUpThege9LTIxc5pRlUZ3 JrQesnccWOmOjzU6f6syls4tY5c5Q0E6B/6Iq9lDyQ5/TudAfKd+Mf1RZHP96FgRLhj3 /OgxeFaYNQ466o6QKaLrmi2h5dJzIJ3XOVrt+ftTGwXjl9zFFlkArpJySVZNfqVjZPBg VPFcUcwMxxtZtVbKRXnuwTqGaFfuaBPJKnI96UVYcCXIChODWL9PrbDwzipscZsoFSsh ocnw== X-Gm-Message-State: AOAM530YIIqoEwBA4vqtS1VmbVpLH48Cil+hk6H9fmJeqP0vXPeSL2I5 CJ9wkDualVhyeluVJUFUBPwHd67e0qbvxyb7MYGWew== X-Google-Smtp-Source: ABdhPJx2UBkNED3/9hHyTSiNuWoXHKq1N581rmLGzOUvrwyXHHPbCqLGn9IKZTWcyX/5LCwok4GTS/LwEPR/YNlHaJY= X-Received: by 2002:a25:2d3:: with SMTP id 202mr6961928ybc.111.1635532692993; Fri, 29 Oct 2021 11:38:12 -0700 (PDT) MIME-Version: 1.0 References: <20211017005020.2645717-1-maskray@google.com> <1763c6f4-dfb9-e102-84d6-892ee2a3208a@redhat.com> In-Reply-To: <1763c6f4-dfb9-e102-84d6-892ee2a3208a@redhat.com> From: =?UTF-8?B?RsSBbmctcnXDrCBTw7JuZw==?= Date: Fri, 29 Oct 2021 11:38:01 -0700 Message-ID: Subject: Re: [PATCH v2] elf: Support DT_RELR relative relocation format [BZ #27924] To: "Carlos O'Donell" Cc: libc-alpha@sourceware.org, binutils@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-18.1 required=5.0 tests=BAYES_00, 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Fri, 29 Oct 2021 18:38:14 -0000 On Fri, Oct 29, 2021 at 11:21 AM Carlos O'Donell wrote: > > On 10/16/21 20:50, Fangrui Song via Binutils wrote: > > PIE and shared objects usually have many relative relocations. In > > 2017/2018, SHT_RELR/DT_RELR was proposed on > > https://groups.google.com/g/generic-abi/c/bX460iggiKg/m/GxjM0L-PBAAJ > > ("Proposal for a new section type SHT_RELR") and is a pre-standard. RELR > > usually takes 3% or smaller space than R_*_RELATIVE relocations. The > > virtual memory size of a mostly statically linked PIE is typically 5~10% > > smaller. > > We've been going over this patch on the weekly Monday patch queue review. > > I took a note to point out that one of the blockers here is that it is difficult > to immediately test this work because it requires a working glibc build using > ldd (which has support for DT_RELR). No:) There may be a misunderstanding. To test the feature: a DT_RELR executable is needed. Currently only ld.lld --pack-dyn-relocs=relr supports generating DT_RELR binaries, but glibc itself does not need to be linked with ld.lld. If the patch is accepted, GNU ld built glibc will support DT_RELR programs linked by ld.lld. ld.lld has supported --pack-dyn-relocs=relr since 2017-12. ld.lld --pack-dyn-relocs=relr (-pie|-shared) produced output works on Android, Fuchsia, FreeBSD (https://reviews.freebsd.org/D32524) You can see that the code here is fully generic, not tightly to a specific linker. For my purpose and to Linux distro's interest, I'd definitely want to see that the glibc patch is accepted even in the lack of GNU ld support. > What is the status of the lld support patches for glibc? aarch64 and x86-64 work well for me. Seems that Adhemerval may be interested in adding a lld configuration to scripts/build-many-glibcs.py > If we made progress on the lld support then we'd be able to more easily review > a testable configuration and keep the review going forward. > > -- > Cheers, > Carlos. >