From patchwork Wed May 4 12:20:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 53453 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3028E3856245 for ; Wed, 4 May 2022 12:20:42 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 32937385782C for ; Wed, 4 May 2022 12:20:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 32937385782C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 20A311F745; Wed, 4 May 2022 12:20:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1651666825; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6TLM3Mb+x0QluZ9Db3NHNAJ+yq0FNqOp6akpYLO9glo=; b=AzV988Y+st0pKMR6a0k/lbtkXc3k2zImCweXUKwfZq1R+1a8Et8dQKB1V7fCQPKjEezOTj ofYo3do/s+mu5tudsFssG2v4E57Ni09G6w+W5u8VoIxh187dPM2pws6S7x6F3MExeT1Z/a kIt+ShCE4R/x3iNL7IOg2wtCBe2zozI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1651666825; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6TLM3Mb+x0QluZ9Db3NHNAJ+yq0FNqOp6akpYLO9glo=; b=3N036MBnkDaNp5poA95NqwYsv1ZK/hMsHZpfrpAzgJW+aTBvW1cA0BhGfDrah1krWU0FQ8 Wp8T8ngm5wZ2eAAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0945D131BD; Wed, 4 May 2022 12:20:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id MahOAYlvcmLAWAAAMHmgww (envelope-from ); Wed, 04 May 2022 12:20:25 +0000 Message-ID: <27841a42-baef-d53e-c601-ad265030854d@suse.cz> Date: Wed, 4 May 2022 14:20:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] lto-plugin: add support for feature detection To: gcc-patches@gcc.gnu.org References: <63633ead-aa7e-c424-9851-ac332ac13df3@suse.cz> Content-Language: en-US In-Reply-To: <63633ead-aa7e-c424-9851-ac332ac13df3@suse.cz> X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Hubicka Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" The patch is a follow-up of the discussion we've got in: https://gcc.gnu.org/pipermail/gcc-patches/2022-May/593901.html Mold linker would appreciate knowing in advance if get_symbols_v3 is supported by a GCC plug-in or not. Ready to be installed? Thanks, Martin lto-plugin/ChangeLog: * lto-plugin.c (supports_get_symbols_v3): Add symbol. --- lto-plugin/lto-plugin.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c index 47378435612..049f3841d5b 100644 --- a/lto-plugin/lto-plugin.c +++ b/lto-plugin/lto-plugin.c @@ -1554,3 +1554,8 @@ onload (struct ld_plugin_tv *tv) return LDPS_OK; } + +/* The following symbols are used for dynamic detection of plug-in features + from linker side. */ + +bool supports_get_symbols_v3;