From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id A73DD3858D33 for ; Sat, 16 Sep 2023 08:20:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A73DD3858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-68fb79ef55eso2716737b3a.0 for ; Sat, 16 Sep 2023 01:20:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694852437; x=1695457237; darn=sourceware.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=6ZcdmkDsU/zAqlaJYs1fi3iS2tDsIATe8JBQtefwhr8=; b=ECg3OFJtCnmOwWQxdr6FGphUgPcJjN35BlIDRtTvohF870qNshmrPO06olur9nvnRx 1g8R/MXdM6+tu3B3RiDAIKh/NKGZTnrTdwT3rcqh3pn8G5CFxrQTSoN+KesELd7JiTyX zwmyzAc5ZaPAIu7VIRQV2ofl5ihhQPinnRik0zuSS5w5a6d+9Y+rnqv55kGP1HkeU6tX PEQ/avDew//yQVzLliDG+Wo4DR2nUJA4kuCpHnUW5LTNp44M1mvbQOURSnMFAtWC+M5m JnX7qlf2hhMTcFwZmYhrkuizk+6bl3SfbcpPPug9oFvsEvIC9FvZXg9Y27P+0VVh5dn0 A4Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694852437; x=1695457237; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6ZcdmkDsU/zAqlaJYs1fi3iS2tDsIATe8JBQtefwhr8=; b=UUdOegBpz7+EFweQfCMFi8tKY91WmB2cg3Dr5vEme8n6mUxCAwifEc11F7mDqUlbHv 0ZC/1y05zU2C5fu5v1RfVS7dQaLQE33LAfk2A1hXoIkFU8GB7kDO9hrGTDg+hCkWqu08 zsEPzDFlva4m3UO/AWDU4Nlz+kmwK0r9NlIO0UsrwEORHeL5V5mTIOQu1p8DqrIeYLOE rYQjhyCUf9UljWmjXVc57WN1V2CKGWESKAGsKKxJ2B0l/SFVoXdDm3vxYOtuL5IqsGBf 6UmQZWAutIqRFuIQnRpX4hkpOZddPQoavQHFWKCeJdrEPtujKBe+ZfbLtDggKnv0y2hU ET/w== X-Gm-Message-State: AOJu0YzDEVDD8ODW6Gmla6Bk5oKHKdCCesYbBloJfjB8pa1Vwrw9BRNk B44ccvrUcRVrk1QPcrH3ClvYC2/cWkE= X-Google-Smtp-Source: AGHT+IEeup9PyPGF0LxowRFpr/LaxJDq4dqU2NcRMbgj2X1qip9adBLcdjvW8F0nRXITeNC6bL4Ssw== X-Received: by 2002:a05:6a00:84c:b0:686:24e1:d12e with SMTP id q12-20020a056a00084c00b0068624e1d12emr4588843pfk.30.1694852436767; Sat, 16 Sep 2023 01:20:36 -0700 (PDT) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id 13-20020aa7914d000000b006829969e3b0sm4070942pfi.85.2023.09.16.01.20.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 01:20:35 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 2D4F9114249E; Sat, 16 Sep 2023 17:50:32 +0930 (ACST) Date: Sat, 16 Sep 2023 17:50:32 +0930 From: Alan Modra To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: binutils@sourceware.org Subject: Re: [PATCH] ld: write full path to included file to dependency-file Message-ID: References: <20230914064235.275964-1-thomas@t-8ch.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230914064235.275964-1-thomas@t-8ch.de> X-Spam-Status: No, score=-3034.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Sep 14, 2023 at 08:42:27AM +0200, 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 full path is > actually available, in ldfile_find_command_file(). This patch is incomplete. ldfile_find_command_file possibly opens a file in two places. > --- > ld/ldfile.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/ld/ldfile.c b/ld/ldfile.c > index b8fd4e5d8e0a..56b221c25d68 100644 > --- a/ld/ldfile.c > +++ b/ld/ldfile.c > @@ -643,6 +643,8 @@ ldfile_find_command_file (const char *name, > { > path = concat (search->name, slash, name, (const char *) NULL); > result = try_open (path, sysrooted); > + if (result) > + track_dependency_files (path); > free (path); > if (result) > break; > @@ -711,8 +713,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; > > base-commit: 95ebc6fdec5780bf59685739cdd55cd41d0f55ac > -- > 2.42.0 -- Alan Modra Australia Development Lab, IBM