PR 30568
  * ldfile.c (ldfile_try_open_bfd): Do not track lto generated temporary files.
+2023-06-28  Nikita Popov  <npopov@redhat.com>
+           Nick Clifton  <nickc@redhat.com>
+
+       PR 30568
+       * ldfile.c (ldfile_try_open_bfd): Do not track lto generated
+       temporary files.
+
 2023-06-21  Nick Clifton  <nickc@redhat.com>
 
        PR 29072
 
       return false;
     }
 
-  track_dependency_files (attempt);
+  /* PR 30568: Do not track lto generated temporary object files.  */
+  if (!entry->flags.lto_output)
+    track_dependency_files (attempt);
 
   /* Linker needs to decompress sections.  */
   entry->the_bfd->flags |= BFD_DECOMPRESS;