From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 56E283858432 for ; Fri, 4 Feb 2022 20:41:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 56E283858432 Received: by mail-pf1-x430.google.com with SMTP id c194so6036158pfb.12 for ; Fri, 04 Feb 2022 12:41:05 -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=uNjpTQ5tU0UO6uI+GQ/c68+mmdW8Jn9aqjukemLdCCg=; b=Kr0cVOXmj5lrH36mEEFrbBJPEV+LWnzHNnGsKE17OvCf50FzItVnvdu+JmzwVjhHan javevHDXOqBK0ZftcBiQz6Wec2HMmqOhFSZZGto3gjQYWfzqWf6aayB/OAPdWpw5ZLxh XKFxDetXtqYG4rnZgWNB2gmHdhoLwkEMHKi8UhDU6Q8o/f2srh6jZMjanOfvG0XDQG71 QwNzRk7iYSLXiaBZJBiIB0vrsN/7GM0WNbjhJsGW7pwZc8nDkS5q8GvNu8xtOacUrPvs Gfmy+tyOVCoNU3+dCsfJMNoFoo5Y6D2+aHc2SfYNGPSAsmycWxE5t1fiWp5nrXg3o2+L Q6Eg== X-Gm-Message-State: AOAM533sM1K+65mS0NfRjzHSmt9BO/6yQDovLc5lh3ta0N7WnRExXKhB y7lVLqh82c5qee1MIyoHl+HonL6t+zJhxP5UVUtT3r5bZbc= X-Google-Smtp-Source: ABdhPJxla3aDHp7ANVZzo2ENSq1W8seNA/d+E64TLdPiSq9R3dphqHV2+EpeQsci2uNU+r/m4zabY9PkDpQXq2goTzs= X-Received: by 2002:aa7:888b:: with SMTP id z11mr4866584pfe.76.1644007264465; Fri, 04 Feb 2022 12:41:04 -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:40:28 -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.2 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:41:09 -0000 On Fri, Feb 4, 2022 at 12:11 PM Joseph Myers wrote: > > On Fri, 4 Feb 2022, H.J. Lu via Libc-alpha wrote: > > > 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. > > It's important that glibc 2.36 supports the same executables and shared > libraries on a given platform, independent of the binutils version used to > build glibc. If any build of glibc 2.36 for some platform supports RELR > relocations, all builds of it for that platform must support such > relocations. > > That means that configure tests for linker support can *only* affect > whether glibc is built to *use* such relocations itself - not whether it > supports loading executables and shared libraries that use them. > > (You could also increase the minimum linker version for building glibc for > a given platform, but the RELR support is too recent for it to be a good > idea to make the minimum version new enough to include RELR support.) Good point. How about "enable DT_RELR only if SUPPORT_DT_RELR is defined? Currently, only x86 defines SUPPORT_DT_RELR. -- H.J.