public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb] ld: write resolved path to included file to dependency-file
Date: Thu, 21 Sep 2023 06:03:20 +0000 (GMT)	[thread overview]
Message-ID: <20230921060320.10CE83858C31@sourceware.org> (raw)

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

commit 0ad14a8c34c866f64271041cb69b0e8a05913de8
Author: Thomas Weißschuh <thomas@t-8ch.de>
Date:   Thu Sep 21 08:03:09 2023 +0200

    ld: write resolved path to included file to dependency-file
    
    In ldfile_open_command_file_1() name written to the dependency files is
    the name as specified passed to the "INCLUDE" directive.
    This is before include-path processing so the tracked dependency
    location is most likely wrong.
    
    Instead track the opened file at the point where the resolved path is
    actually available, in try_open().
    
    Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>

Diff:
---
 ld/ldfile.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ld/ldfile.c b/ld/ldfile.c
index df7c9cbd65e..8f869c1f19e 100644
--- a/ld/ldfile.c
+++ b/ld/ldfile.c
@@ -743,7 +743,10 @@ try_open (const char *name, bool *sysrooted)
   result = fopen (name, "r");
 
   if (result != NULL)
-    *sysrooted = is_sysrooted_pathname (name);
+    {
+      *sysrooted = is_sysrooted_pathname (name);
+      track_dependency_files (name);
+    }
 
   if (verbose)
     {
@@ -925,8 +928,6 @@ ldfile_open_command_file_1 (const char *name, enum script_open_style open_how)
       return;
     }
 
-  track_dependency_files (name);
-
   lex_push_file (ldlex_input_stack, name, sysrooted);
 
   lineno = 1;

                 reply	other threads:[~2023-09-21  6:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230921060320.10CE83858C31@sourceware.org \
    --to=jbeulich@sourceware.org \
    --cc=bfd-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).