From: H.J. Lu Date: Fri, 23 Aug 2024 12:36:45 +0000 (-0700) Subject: lto: Don't check obj.found for offload section X-Git-Tag: basepoints/gcc-16~6418 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb51e0b236c7d492af2033582230e78d8b55290f;p=thirdparty%2Fgcc.git lto: Don't check obj.found for offload section 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 --- 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