From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by sourceware.org (Postfix) with ESMTPS id C20593857C43 for ; Fri, 21 Aug 2020 10:44:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C20593857C43 IronPort-SDR: bSPvqVswKyThU7TaMv1sGK8Lp6xEnEMA5k9mAhuvV7HnP7VWiaZzjJqX/m3m/4yd0pBUslPKQH gsdmGJPWcoYpTi8GWnfxFZh7QSr4B2Ll89K/4F18p9c8KL5xAllaPnxpWT1fmZAcv7fx/zt8k3 zbTFKp5ymLHvUR3woGn1lT3eeLsU31o8PUy7DKYedAXBqAE+z/UW/ksH+7vkDe2ik3yotklD9j UQjJtk7yxPOYB6YWtjGVtmwY048jdvA2aTNTaKY80zXKdpQEsYw3EAQYlV6r5/avKK8U3TGYpC uGY= X-IronPort-AV: E=Sophos;i="5.76,335,1592841600"; d="scan'208";a="145513972" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 21 Aug 2020 18:44:23 +0800 IronPort-SDR: h9+kzCZ4QGqC4Guw4RyrCuLWzih03OwM4zy2ty3BrxS6D+0OeDLCNP+qbTUZUo2m1woi4Awaxo 9PNX2j6QAcEA== Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Aug 2020 03:31:17 -0700 IronPort-SDR: IGx7hQHUwKdQN1Xg6K2m339K2UqV10i/ZG2KdMvgIafFmsY1ddXLW3AmZtnPSQqTk2bW3yiYrQ +Vij598otNTg== WDCIronportException: Internal Received: from unknown (HELO redsun52) ([10.149.66.28]) by uls-op-cesaip01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Aug 2020 03:44:21 -0700 Date: Fri, 21 Aug 2020 11:44:16 +0100 (BST) From: "Maciej W. Rozycki" To: Alistair Francis cc: Jim Wilson , Florian Weimer , Alistair Francis via Libc-alpha , Andreas Schwab , Alistair Francis Subject: Re: [PATCH] Allow memset local PLT reference for RISC-V. In-Reply-To: Message-ID: References: <20200622211034.659739-1-alistair.francis@wdc.com> <87o8p21bjh.fsf@oldenburg2.str.redhat.com> <87366dx35x.fsf@oldenburg2.str.redhat.com> <87sgedvnq3.fsf@oldenburg2.str.redhat.com> <87o8p1vnb9.fsf@oldenburg2.str.redhat.com> <87ftadvmnv.fsf@oldenburg2.str.redhat.com> <87r1txyfew.fsf@igel.home> <87a70lvm48.fsf@oldenburg2.str.redhat.com> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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, 21 Aug 2020 10:44:25 -0000 On Thu, 20 Aug 2020, Alistair Francis wrote: > > The `h->needs_plt' flag is set by this `riscv_elf_check_relocs' code in > > bfd/elfnn-riscv.c: > > > > case R_RISCV_CALL_PLT: > > /* This symbol requires a procedure linkage table entry. We > > actually build the entry in adjust_dynamic_symbol, > > because this might be a case of linking PIC code without > > linking in any dynamic objects, in which case we don't > > need to generate a procedure linkage table after all. */ > > > > if (h != NULL) > > { > > h->needs_plt = 1; > > h->plt.refcount += 1; > > } > > break; > > > > due to a reference from `addtf3.o', from `libgcc.a'. There are further 20 > > references for a total of 21. There is a later opportunity for the flag > > to be cleared in `riscv_elf_adjust_dynamic_symbol', as observed in the > > comment, however that only happens for symbols that bind locally, or which > > are not referenced, and for `memset' obviously neither is the case (and > > `allocate_dynrelocs' sets `h->plt.offset' in place of `h->plt.refcount' > > then). > > > > I don't think we have a way to redirect the reference to `__GI_memset'. > > I'm not really clear where this ended up. I have a session at Plumbers > next week to discuss the RV32 port and am planning on discussing this > issue as well. This: ought to sort it AFAICT. Maciej