From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 39A6B3858D35 for ; Fri, 4 Feb 2022 20:11:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 39A6B3858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: QoBaKuLSW3if6XCBJUhw0hi9Ver+b4iLIOgbOUHLeNUCi7yxnmjpIjx8qy42WO8na7wlX+6eM9 PY/rncTZQ3yztscH5xhQN8Bwp1JsDFP3htA7hAlo7XmyTkVVaIAUOTp8PJZVgG+dC/Z8lOAGVV 7Klw21+BdbhTRnBbJvTy/g/eqQTrweHawFA4t4ODZalC+Hu8Aad16GK/DxUL9bdSNQHWOyI+kP a8w3SjVFNUjeYCStc9hHH7nqZpYctNxA5NvTb1P9k1XCivjWIjsFBkojD8iw140vV0wUmdyNjW DyKyw+tiOQbgEg2zFvBZYzSe X-IronPort-AV: E=Sophos;i="5.88,343,1635235200"; d="scan'208";a="71448875" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 04 Feb 2022 12:10:59 -0800 IronPort-SDR: eUfI6oRhbwhTbq5I5IyrxLHF6g39Vyy8x71HYLCt1+6n/t6QeCJrsic8GFFLOSsMKv48Qyp1jy bABRc6qNXVspqn2zWvCEy69x0+NSqS1mHxGiDpqhQmtP3IUMmxdPShq2WJTP7XLju4TxCYUMPX 1iwUNrxbKPEC/QrNbQL4m7AJxfkzXsG80DTWiyq5Qdcri4jTKO6Lj49xCq7OK7VHKYVnGlvwvJ GB2Z1ABSUUXvnKzODmMEBPz75Lp554y9s2wnHlBNzq+qqV6Mzgk/lEdW9k3L04+MOCZGDy59EW JJI= Date: Fri, 4 Feb 2022 20:10:54 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: "H.J. Lu" CC: GNU C Library Subject: Re: [PATCH 3/7] Add GLIBC_ABI_DT_RELR for DT_RELR support In-Reply-To: Message-ID: References: <20220203180948.2744-1-hjl.tools@gmail.com> <20220203180948.2744-4-hjl.tools@gmail.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-3114.2 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, 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:11:02 -0000 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.) -- Joseph S. Myers joseph@codesourcery.com