From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id 9F7553858000 for ; Thu, 10 Mar 2022 20:09:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9F7553858000 Received: by mail-pl1-x62b.google.com with SMTP id h5so4490174plf.7 for ; Thu, 10 Mar 2022 12:09:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hx80EWYhE00eyXrL+j1LC0I6or3c0Ikq3Fp9cJAKsjc=; b=1k+3FmecVXmpG33u1jfgQ/1zIXOFHvGqv5cEv4srfAXCk7ABBEV/2pUgx0YI/FknO1 UcChzHyXlGAfL/0NRuBjY7YyttG1bwSVy1sBEBbCHYQp49egUoodlccrqigXyHxwZit5 e7lTtvlol+JNiOgJx1iLeD6UiljnpnOwd49iI60C47vwpvcClZiGX97DzU1teFLJ1Imz mxJs56r1ZEUnQdCBVmaDN8A70BlDAiRkNd91rOpqnvTpfv8gdtKKWBF64yMZKoZILj1G DwxVZgmmYa+Ef73cpQeXdh0bACIsjHDsXRhyVFLEeYgrMawvMmnkSp62xZrjTcvygYKv 4ojA== X-Gm-Message-State: AOAM530wRKRYm/4FYg3xoHNmqrT32rGsUTgVpvBo3vk/hYqCKu1slqFx A3ltoMqJRLMpuhLjAhpim2pHig== X-Google-Smtp-Source: ABdhPJzhW+17R38pGNDrfKIoepcwzJwRwVSvvHfPUNnmhf8MknvRyyOyLPLQkfISnJEWr/sNFCeInw== X-Received: by 2002:a17:902:9301:b0:153:2252:44ea with SMTP id bc1-20020a170902930100b00153225244eamr3973319plb.65.1646942970532; Thu, 10 Mar 2022 12:09:30 -0800 (PST) Received: from google.com ([2620:15c:2ce:200:44d3:8d0e:d3e:8ac]) by smtp.gmail.com with ESMTPSA id mq17-20020a17090b381100b001bf355e964fsm11647372pjb.0.2022.03.10.12.09.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Mar 2022 12:09:30 -0800 (PST) Date: Thu, 10 Mar 2022 12:09:25 -0800 From: Fangrui Song To: "H.J. Lu" Cc: libc-alpha@sourceware.org, Joseph Myers Subject: Re: [PATCH v6 0/5] Support DT_RELR relative relocation format Message-ID: <20220310200925.54mcufh3k3ju3nfv@google.com> References: <20220310200329.1935466-1-hjl.tools@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20220310200329.1935466-1-hjl.tools@gmail.com> X-Spam-Status: No, score=-19.6 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, T_SCC_BODY_TEXT_LINE, URIBL_BLACK, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=no 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: Thu, 10 Mar 2022 20:09:33 -0000 On 2022-03-10, H.J. Lu wrote: >Changes in v6: > >1. Move ELF_DYNAMIC_DO_RELR before ELF_DYNAMIC_DO_REL. > >Changes in v5: > >1. Update NEWS entry with the linker option, -z pack-relative-relocs. >2. Remove elf/libc-abi-version.exp and use $(READELF) to check >GLIBC_ABI_DT_RELR. > >Changes in v4: > >1. Always enable GLIBC_ABI_DT_RELR check. >2. Use $(OBJDUMP) instead of $(NM) for GLIBC_ABI_DT_RELR check. > >Changes in v3: > >1. Don't define SUPPORT_DT_RELR. >2. Enable DT_RELR in glibc shared libraries and position independent >executables (PIE) automatically if linker supports -z pack-relative-relocs. > >Changes in v2: > >1. Enable DT_RELR for all targets. >2. Issue an error if there is a DT_RELR entry without GLIBC_ABI_DT_RELR >dependency nor GLIBC_PRIVATE definition. > >--- >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. > >Binutils 2.38 supports DT_RELR on x86 with the -z report-relative-reloc >option. When DT_RELR is enabled, ld adds a GLIBC_ABI_DT_RELR symbol >version dependency on libc.so to outputs. Issue an error if there is a >DT_RELR entry without GLIBC_ABI_DT_RELR dependency nor GLIBC_PRIVATE >definition. > >DT_RELR is enabled in glibc shared libraries and position independent >executables (PIE) automatically if linker supports -z pack-relative-relocs. > >The DT_RELR usage in glibc can be disabled with --disable-default-dt-relr. > >Tested with binutils 2.38 on i686, x86-64 and x32. > >Fangrui Song (1): > elf: Support DT_RELR relative relocation format [BZ #27924] > >H.J. Lu (4): > elf: Properly handle zero DT_RELA/DT_REL values > Add GLIBC_ABI_DT_RELR for DT_RELR support > Add --disable-default-dt-relr > NEWS: Mention DT_RELR support > > INSTALL | 6 ++++ > Makeconfig | 19 +++++++++++++ > Makerules | 2 ++ > NEWS | 3 +- > configure | 60 +++++++++++++++++++++++++++++++++++++++ > configure.ac | 23 +++++++++++++++ > elf/Makefile | 30 ++++++++++++++++++-- > elf/Versions | 5 ++++ > elf/dl-version.c | 33 ++++++++++++++++++++-- > elf/dynamic-link.h | 40 +++++++++++++++++++++++++- > elf/elf.h | 13 +++++++-- > elf/get-dynamic-info.h | 19 +++++++++++-- > elf/tst-relr-pie.c | 1 + > elf/tst-relr.c | 64 ++++++++++++++++++++++++++++++++++++++++++ > include/link.h | 6 ++++ > manual/install.texi | 5 ++++ > scripts/abilist.awk | 2 ++ > scripts/versions.awk | 7 ++++- > 18 files changed, 325 insertions(+), 13 deletions(-) > create mode 100644 elf/tst-relr-pie.c > create mode 100644 elf/tst-relr.c > >-- >2.35.1 > Thanks. Every change looks good to me now. Other folks can check my extensive comments on previous iterations on the patch series https://sourceware.org/pipermail/libc-alpha/2022-March/ Reviewed-by: Fangrui Song