From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 5954338582AB for ; Thu, 11 May 2023 07:27:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5954338582AB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 778CE1FD84; Thu, 11 May 2023 07:27:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1683790024; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eS1v4qkuLB9XIYHIIqvXAPyNSopSG7+2reJsvX4zBPQ=; b=t8VWee6UOPAD8DDvy4uUTgVrf8tumCy+WS9S12LUDDc0PtIc19OsAXMRYYoLWquoYV/e0f LSP1O9FnUFqlaTGxKTn98CnRzTwJTmSVobKl1u0A0IMDQEFAVu/RseCUitxao40PUHAgwU y51x7kzqOVGGYEUCMHxSvgBu/w4/1ho= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1683790024; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eS1v4qkuLB9XIYHIIqvXAPyNSopSG7+2reJsvX4zBPQ=; b=HL/nljhakH2/ukXq6sWTX8+R6wShqGRPgfaWKReQkFPu8UoLESYy+YlCRZKHxTDrP1+bRY YvOPO2yGGMnY9XDA== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 3A19B2C141; Thu, 11 May 2023 07:27:04 +0000 (UTC) Date: Thu, 11 May 2023 07:27:04 +0000 (UTC) From: Richard Biener To: Alan Modra cc: Tobias Burnus , Binutils , gcc-patches , Joseph Myers Subject: Re: [RFC,patch] Linker plugin - extend API for offloading corner case (aka: LDPT_REGISTER_CLAIM_FILE_HOOK_V2 linker plugin hook [GCC PR109128]) In-Reply-To: Message-ID: References: <3cdc56a8-62eb-d33c-3038-0af00d8a52ba@codesourcery.com> <0f441079-0fe3-3c25-f983-627f56406b1c@codesourcery.com> User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, 11 May 2023, Alan Modra wrote: > On Thu, May 04, 2023 at 11:02:25AM +0000, Richard Biener via Binutils wrote: > > So since we expect the linker to use the host side table is there a way > > for the plugin to exactly query that (the set of symbols the linker > > uses from the object passed to the plugin)? > > That would be possible and relatively easy to implement, but might be > slow. > > > Because if the linker > > uses something from the file but _not_ the host side offload table > > (-ffunction-sections -fdata-sections) then things would still go > > wrong, right? > > > Is there a way to connect both in a way that the linker discards > > either if the other isn't present? > > No, or at least I do not want to even think about implementing such a > linker "feature". The problem is that after you have modified the > global linker symbol table after adding an object's symbols, it is > virtually impossible to restore the state of symbols to what they > would be without that object. (Yes, we do that sort of thing for > as-needed shared libraries, but the restoration happens immediately > after adding the symbols. I also regret implementing it the way I > did.) Thanks for explaining. > The patch posted is OK from the linker side of things. OK, then lets go with it and hope it fixes the issue for good. Thanks, Richard.