From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by sourceware.org (Postfix) with ESMTPS id 6FFE63858CD1 for ; Sat, 16 Sep 2023 10:36:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6FFE63858CD1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=t-8ch.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=t-8ch.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=t-8ch.de; s=mail; t=1694860594; bh=YlE22fNbpswYUwdgZ6BW6GlP9BMJeOZm9k3zmCwd6HU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GYI7pSSFVym0P6ppPGo+AqVbu5qMyN3yqRo5qEI9yYOdvjPeBVtxpy1z3SsdVCqQO Lyn2T5nST/Ow8LgDjLuurPEp7ObOhSXxtK5MBYFoB29h5rihJkOKAiZ4TflW3SnWo4 Ka/JhvtzzD2ty0zFpfpwA6jYRWIEm1aCOY9Wy2KE= From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= To: binutils@sourceware.org Cc: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Alan Modra Subject: [PATCH v2 2/2] ld: write full paths to dependency-file Date: Sat, 16 Sep 2023 12:36:17 +0200 Message-ID: <20230916103619.819791-3-thomas@t-8ch.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230916103619.819791-1-thomas@t-8ch.de> References: <20230916103619.819791-1-thomas@t-8ch.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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: When relative paths are written to the dependency-file it forces the users of it to run from the same directory. To avoid this only write absolute paths. Signed-off-by: Thomas Weißschuh --- ld/ldmain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ld/ldmain.c b/ld/ldmain.c index 25cc89b72f90..f11ee6696125 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -174,7 +174,7 @@ track_dependency_files (const char *filename) { struct dependency_file *dep = (struct dependency_file *) xmalloc (sizeof (*dep)); - dep->name = xstrdup (filename); + dep->name = lrealpath (filename); dep->next = NULL; if (dependency_files == NULL) dependency_files = dep; -- 2.42.0