From patchwork Fri Aug 23 12:36:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1976035 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=cdwOAf74; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wr02H3Qv5z1yNr for ; Fri, 23 Aug 2024 22:37:10 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 426C938708C9 for ; Fri, 23 Aug 2024 12:37:08 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com [IPv6:2001:4860:4864:20::2c]) by sourceware.org (Postfix) with ESMTPS id 96137385E837 for ; Fri, 23 Aug 2024 12:36:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 96137385E837 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 96137385E837 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4860:4864:20::2c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724416610; cv=none; b=mf7ye74eoJf4qtnqT6oM6COQxr75zC1dRJ6901epHhwGqfhsSOO2Hji+niTaa9M9qhUokrJByQXVbZoAsr2HifW9+aAaVuun3k+kvwzNzoE0hjwTNgeLVWOhbXlkYhBjYyr3O0jUNhWXOG7TLoYkL1Sy/0RueJrQWBGju2z6nuQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724416610; c=relaxed/simple; bh=JyPUI3F6u1XoyWpUgxRaZO75Z5G92012UzuoECIWas4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=xDRvhhiFgWs6/kneb1ftSzTdjykxV6oq2ee9UHmx3tajoV5neF05gc6G1PUcPPfQX7Ot79kv60dV6jiu1OmzhNVpxOWQ3CsKsaRmilgOq+eGNowWfI07aCiSz2Dx0CTORVgNqtLXvFX7UuTq+zeLBnTBKs76e72AMI1e9c6Clfw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-2702ed1054fso1375695fac.3 for ; Fri, 23 Aug 2024 05:36:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724416607; x=1725021407; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Rm5XaA8HJKybAgjePeIWCfvuoTLQs+Ibc0KUoT5YYK0=; b=cdwOAf747a8NlDfGR2Z0ipAIFQSFYwTo3ip9NmezGwiHYt5FlC1c6lBOVCUYXULp5R 9YkU1/O1vQ+5jzr01FjBnEw9cXsWGF6YcUpsY5m4AkRPmZoaEFeuwp0W3adTaQX9y4Kj 8p5wCe8tiURYv8ivntp7R6h31yQUFfK6mPwGKO2jp60cvkuMPoxjf0E8OsjsQMWRIRTu 2ud4l5C6qh34V0niu2C9Xj2j20xYy9+FmRY9vQ8XNApzpSB0NuK+B6CiR1MwfsLa1Q3w wLbXqcZGoh4iNNC5ujPG9iUFdMCWpCaVFB68Exbx+Pq/UjzFITNRmP+Q+xeaR+4c0jSF 97Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724416607; x=1725021407; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Rm5XaA8HJKybAgjePeIWCfvuoTLQs+Ibc0KUoT5YYK0=; b=Z9guv0E+2aOVfQCe1yM/yKSOAiWdkvUnefT3vvlancPawZ3mvG1wB0MfXyd0xdfQm5 +8WtBLwcJftVVbe54QDqk++N0wYI/i/4zSiuQe0DOid0ogKiNZN9j6KURn4GQOw1LXcc ckVqy2X1GbCNtJ6a34ryWMowJMUyOHr+VKgh9wCz/GpDoAppcxQ4pRBjpOAVbeoh9O6E nZkhDY8xHC5n/rOIzPCbH9heDlzuixfQi8SdAsc/ucV7gzGKssfjWuZLC1k2PeMv8uSt rcA+P/kGUYrnnDisoKhmM6rEahB/fHq2OYi30TL/SdTDZ4nXqk2s8z0hkrACx3BESH/M hHdQ== X-Gm-Message-State: AOJu0YyrmR9DlU7Y2bHvvjojkoBaUdh6NDVzDwrcALCNsyxG1H0phTOx /yWqVvVXeUzAU6TkUKwPjRwxtUdhy4NLQRYP/qmZLOUbFS1d0m+LSxKj2nXl X-Google-Smtp-Source: AGHT+IFjkhjF902slzLMDh1RwfVZSswkdbv01ZrOmySzUpl5z247rrBu6Kk1RIbTlX1IVR7gGuAWhA== X-Received: by 2002:a05:6870:700f:b0:25d:f0ba:eab7 with SMTP id 586e51a60fabf-273e6472850mr2167263fac.18.1724416607253; Fri, 23 Aug 2024 05:36:47 -0700 (PDT) Received: from gnu-cfl-3.localdomain ([172.59.129.158]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-714342e03aesm2937906b3a.111.2024.08.23.05.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Aug 2024 05:36:46 -0700 (PDT) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id ABD34740330; Fri, 23 Aug 2024 05:36:45 -0700 (PDT) From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Cc: prathameshk@nvidia.com, richard.guenther@gmail.com Subject: [PATCH] lto: Don't check obj.found for offload section Date: Fri, 23 Aug 2024 05:36:45 -0700 Message-ID: <20240823123645.1564801-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-Spam-Status: No, score=-3019.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org obj.found is the number of LTO symbols. We should include the offload section when it is used by linker even if there are no LTO symbols. PR lto/116361 * lto-plugin.c (claim_file_handler_v2): Don't check obj.found for the offload section. Signed-off-by: H.J. Lu --- lto-plugin/lto-plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c index 61b0de62f52..c564b36eb92 100644 --- a/lto-plugin/lto-plugin.c +++ b/lto-plugin/lto-plugin.c @@ -1320,7 +1320,7 @@ claim_file_handler_v2 (const struct ld_plugin_input_file *file, if (*can_be_claimed && !obj.offload && offload_files_last_lto == NULL) offload_files_last_lto = offload_files_last; - if (obj.offload && known_used && obj.found > 0) + if (obj.offload && known_used) { /* Add file to the list. The order must be exactly the same as the final order after recompilation and linking, otherwise host and target tables