diff options
author | Thomas Weißschuh <thomas@t-8ch.de> | 2023-09-21 08:03:09 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2023-09-21 08:03:09 +0200 |
commit | 0ad14a8c34c866f64271041cb69b0e8a05913de8 (patch) | |
tree | 5352ef791b4835a3cf01b28fe4b8ccd8dcd78684 /ld | |
parent | f21e7f44e49682c849be3936b3b401276816846d (diff) | |
download | gdb-0ad14a8c34c866f64271041cb69b0e8a05913de8.zip gdb-0ad14a8c34c866f64271041cb69b0e8a05913de8.tar.gz gdb-0ad14a8c34c866f64271041cb69b0e8a05913de8.tar.bz2 |
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>
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ldfile.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ld/ldfile.c b/ld/ldfile.c index df7c9cb..8f869c1 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; |