public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "Thomas Weißschuh" <thomas@t-8ch.de>
Cc: Alan Modra <amodra@gmail.com>, binutils@sourceware.org
Subject: Re: [PATCH v2 1/2] ld: write resolved path to included file to dependency-file
Date: Mon, 18 Sep 2023 15:28:49 +0200	[thread overview]
Message-ID: <ce3a546a-3bcc-6c47-b741-d18b5c8820fb@suse.com> (raw)
In-Reply-To: <20230916103619.819791-2-thomas@t-8ch.de>

On 16.09.2023 12:36, Thomas Weißschuh wrote:
> 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>

Looks okay to me, with (nit) ...

> --- a/ld/ldfile.c
> +++ b/ld/ldfile.c
> @@ -528,8 +528,10 @@ try_open (const char *name, bool *sysrooted)
>  
>    result = fopen (name, "r");
>  
> -  if (result != NULL)
> +  if (result != NULL) {

... style corrected here:

  if (result != NULL)
    {
      *sysrooted = is_sysrooted_pathname (name);
      track_dependency_files (name);
    }

Jan

  reply	other threads:[~2023-09-18 13:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-16 10:36 [PATCH v2 0/2] Improve handling of included linker scripts in dependency-file Thomas Weißschuh
2023-09-16 10:36 ` [PATCH v2 1/2] ld: write resolved path to included file to dependency-file Thomas Weißschuh
2023-09-18 13:28   ` Jan Beulich [this message]
2023-09-16 10:36 ` [PATCH v2 2/2] ld: write full paths " Thomas Weißschuh
2023-09-18 13:38   ` Jan Beulich
2023-09-18 19:35     ` Thomas Weißschuh

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=ce3a546a-3bcc-6c47-b741-d18b5c8820fb@suse.com \
    --to=jbeulich@suse.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=thomas@t-8ch.de \
    /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).