[binutils-gdb] Stop the linker's --dependency-file option from including temporary lto files.

Nick Clifton nickc@sourceware.org
Wed Jun 28 12:50:39 GMT 2023


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b25c1a15cbac78e592d7a0c749dec2fcc175ec39

commit b25c1a15cbac78e592d7a0c749dec2fcc175ec39
Author: Nick Clifton <nickc@redhat.com>
Date:   Wed Jun 28 13:49:43 2023 +0100

    Stop the linker's --dependency-file option from including temporary lto files.
    
      PR 30568
      * ldfile.c (ldfile_try_open_bfd): Do not track lto generated temporary files.

Diff:
---
 ld/ChangeLog | 7 +++++++
 ld/ldfile.c  | 4 +++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 1467128eb61..084c96dce96 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+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
diff --git a/ld/ldfile.c b/ld/ldfile.c
index 4976367bbf0..c8a6874978b 100644
--- a/ld/ldfile.c
+++ b/ld/ldfile.c
@@ -352,7 +352,9 @@ ldfile_try_open_bfd (const char *attempt,
       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;


More information about the Binutils-cvs mailing list