From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id 6745D3858D35 for ; Fri, 4 Feb 2022 20:04:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6745D3858D35 Received: by mail-pf1-x432.google.com with SMTP id e28so5999566pfj.5 for ; Fri, 04 Feb 2022 12:04:48 -0800 (PST) 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=O6iVnQ/OrjW9XXVvjTRZ1Y8n2lcZJXbr9lH1NJBovpw=; b=TLQANDrJdfwgFA3hslRUXeO0MZo2TQQEOW0ehZulz546hBnBF7ghqlnTizy98gfD0c ss5pfFHw59ydWAS9cnz1TjEp9ld+XqdZmSSLdNNlgDpl7PdoWwCxDkrVGwbXd8DwwQ6+ jahNv5y70kF4quhU9aLv8W8huz5+/Oc2Y6SSzPsJA+gBtUUOFRcj8STOQSK3w7QCf9jd 5sAe79lchVOC68OWoHlBFK59jUosxSinmy0G9vmvUWiUV7QIRTR31+yThJtggITamHgT NSKEvlmQjCGWCQ85r3wuPw1+MTTcm99ar2EaPzwHOQdyjWm0+Y1HiCueqBmzU1kGsdtY SErw== X-Gm-Message-State: AOAM5318SehXA+HnWnqX+Gor620q/TR2bAdHDNF/YvDONjD88X1LVPUv B07v20jVymSQ+VRPQimyx6jmo/4DTXcDNIM2LOYq9XuqfIE= X-Google-Smtp-Source: ABdhPJz6pe6zVRdwvTWFW49ruMGU6lnHjC7mhM+4mlg7W3uYvv0Fyi8WhW8BhBZAigEhxaGAvyj3GdtJU56IzpjAVZM= X-Received: by 2002:a63:f542:: with SMTP id e2mr494066pgk.381.1644005087412; Fri, 04 Feb 2022 12:04:47 -0800 (PST) MIME-Version: 1.0 References: <20220203180948.2744-1-hjl.tools@gmail.com> <20220203180948.2744-4-hjl.tools@gmail.com> In-Reply-To: From: "H.J. Lu" Date: Fri, 4 Feb 2022 12:04:11 -0800 Message-ID: Subject: Re: [PATCH 3/7] Add GLIBC_ABI_DT_RELR for DT_RELR support To: Joseph Myers Cc: GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3020.8 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, T_SCC_BODY_TEXT_LINE, URIBL_BLACK 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: Fri, 04 Feb 2022 20:04:52 -0000 On Fri, Feb 4, 2022 at 11:53 AM Joseph Myers wrote: > > On Thu, 3 Feb 2022, H.J. Lu via Libc-alpha wrote: > > > +%if HAVE_DT_RELR > > + GLIBC_ABI_DT_RELR { > > + # This symbol is used only for empty version map and will be removed > > + # by scripts/versions.awk. > > + __placeholder_only_for_empty_version_map; > > + } > > My understanding is that HAVE_DT_RELR describes a property of the linker > used to build glibc, not a property of what features glibc itself > supports. > > The symbol versions provided by glibc, and whether glibc supports binaries > using RELR relocations, should be independent of whether the linker > version used to build glibc supports such relocations. A given glibc > version should either always support RELR relocations (for a given glibc > ABI) or never support them (for that ABI), independent of linker features, > and likewise the symbol versions provided by glibc should be independent > of linker features. > In my cover letter, I said 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. The DT_RELR support is enabled in ld.so only if the linker supports -z report-relative-reloc option. and the first patch has # define ELF_DYNAMIC_RELOCATE(map, scope, lazy, consider_profile, skip_ifunc) \ do { \ int edr_lazy = elf_machine_runtime_setup ((map), (scope), (lazy), \ (consider_profile)); \ ELF_DYNAMIC_DO_REL ((map), (scope), edr_lazy, skip_ifunc); \ ELF_DYNAMIC_DO_RELA ((map), (scope), edr_lazy, skip_ifunc); \ + if (HAVE_DT_RELR && ((map) != &GL(dl_rtld_map) || DO_RTLD_BOOTSTRAP)) \ + ELF_DYNAMIC_DO_RELR (map); \ } while (0) If HAVE_DT_RELR is 0, DT_RELR is disabled. -- H.J.