[binutils-gdb] PR 32359, --dependency-file: wrong error message if fopen fails

Alan Modra amodra@sourceware.org
Fri Nov 15 23:38:09 GMT 2024


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

commit 8eba92c9e224444cc893dd0abf2377701c10f884
Author: Barnabás Pőcze <pobrn@protonmail.com>
Date:   Sat Nov 16 10:04:48 2024 +1030

    PR 32359, --dependency-file: wrong error message if fopen fails
    
    Use of %E in ld error messages requires bfd_error to be set.

Diff:
---
 ld/ldmain.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ld/ldmain.c b/ld/ldmain.c
index 037099b9d37..4fb0d1c864c 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -194,6 +194,7 @@ write_dependency_file (void)
   out = fopen (config.dependency_file, FOPEN_WT);
   if (out == NULL)
     {
+      bfd_set_error (bfd_error_system_call);
       einfo (_("%F%P: cannot open dependency file %s: %E\n"),
 	     config.dependency_file);
     }


More information about the Binutils-cvs mailing list