From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 7C7F93858C27; Mon, 18 Oct 2021 19:22:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7C7F93858C27 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: iN7Tr5MilY2+ec8gG9xVwC9NAP447/OsL6jcVZImZ78AAyfp04a8CpTwmY/EUJErV+6I1O6MaX RHAQSHRfSW6NSVi2jchI7CPbX49Wf/4PZ5vYckM84QjiVza3FzDrsptivxpR13p322fcd0Y6+q fC4hwmUF6ixISv2ehg2k9T5ymlKT+BXcaTabsn2f7hOETEQMo6enDmwwioA5uIoi5zRo88dcz2 SB8zuZPCfvcQSMHxml4HB9F5bsS/3jowvOJ4ByyMZTbIF3JmH13aML1YKLGTFj7vpkHyY5bBFd j4eWq5PQRczqVpuAnK5rFItq X-IronPort-AV: E=Sophos;i="5.85,382,1624348800"; d="scan'208";a="69798546" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 18 Oct 2021 11:21:52 -0800 IronPort-SDR: BvKuICgWeKaIk7iRvyTSTXd3oR5zvUC19ts9Z9Gqt6UGs1Hzq5LZVjZwE/ZZkDj7GlKRyoD5qR K73+zQ+cxPij65Bql6UpttPPivcK8C5H8iQg228Ipp0p5mUp8p7XWtGx5F5xFIy2Zkn0vTlBV9 +BvdKwX7cqWRF0oEa2pogVRA238qoeUQ5hbLwE30JFot+IaGR6JXkRM+LnCiqiDgvnOkud5WoH W3W6isKGrO1dL1uAG8Yq2LKEmkyqU+jWNVXfdHq4H5iUpJ327tPpHzburnSjWZMxzcC7fAeAvd 1X0= Date: Mon, 18 Oct 2021 19:21:46 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: "H.J. Lu" CC: =?UTF-8?Q?F=C4=81ng-ru=C3=AC_S=C3=B2ng?= , GNU C Library , Binutils Subject: Re: [PATCH v2] elf: Support DT_RELR relative relocation format [BZ #27924] In-Reply-To: Message-ID: References: <20211017005020.2645717-1-maskray@google.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-05.mgc.mentorg.com (139.181.222.5) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-3117.5 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP 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: Mon, 18 Oct 2021 19:22:13 -0000 On Mon, 18 Oct 2021, H.J. Lu via Binutils wrote: > For Linux targets, we need the glibc version dependency for > DT_RELR support at run-time. What we've supposedly previously done with new ELF features is use EI_ABIVERSION (see libc-abis in glibc). That requires the static linker to compute the right ABI version based on which of the relevant features is used by the generated binary (note that the ordering of different features, and thus the numbers assigned to them as well as which of them counts as the newest feature to be stored in EI_ABIVERSION, is *not* the same across glibc architectures). I'm not sure the binutils side of things was ever implemented on most architectures, or that the checks in glibc get properly applied to all relevant ELF objects (dynamic linker, main program, loaded shared libraries), but in principle the mechanism exists and avoids the linker needing to know about specific glibc version numbers itself (at the expense of needing to know the per-architecture version numbers and ordering for different ELF features). -- Joseph S. Myers joseph@codesourcery.com