[lld] [lld][test] Fix unintentional write to a non-writeable dir (PR #150436)
Jordan Rupprecht via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 24 08:10:03 PDT 2025
https://github.com/rupprecht created https://github.com/llvm/llvm-project/pull/150436
The test added in #147970 fails trying to write `a.out` when run in a non-writeable directory. I believe the intent was to write to /dev/null as the output, but `-o` was omitted, so it's actually linking *in* /dev/null and writing to `a.out`.
>From b660e29ddfa52abc38838ddf84b8437914b70926 Mon Sep 17 00:00:00 2001
From: Jordan Rupprecht <rupprecht at google.com>
Date: Thu, 24 Jul 2025 08:07:19 -0700
Subject: [PATCH] [lld][test] Fix unintentional write to a non-writeable dir
The test added in #147970 fails trying to write `a.out` when run in a non-writeable directory. I believe the intent was to write to /dev/null as the output, but `-o` was omitted, so it's actually linking *in* /dev/null and writing to `a.out`.
---
lld/test/ELF/aarch64-build-attributes-malformed.s | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lld/test/ELF/aarch64-build-attributes-malformed.s b/lld/test/ELF/aarch64-build-attributes-malformed.s
index f40da1ab7e8a1..c8a0fd62b20aa 100644
--- a/lld/test/ELF/aarch64-build-attributes-malformed.s
+++ b/lld/test/ELF/aarch64-build-attributes-malformed.s
@@ -1,7 +1,7 @@
# REQUIRES: aarch64
# RUN: llvm-mc -triple=aarch64 -filetype=obj %s -o %t.o
-# RUN: ld.lld %t.o /dev/null 2>&1 | FileCheck %s
+# RUN: ld.lld %t.o -o /dev/null 2>&1 | FileCheck %s
# CHECK: (.ARM.attributes): unexpected end of data at offset 0x3f while reading [0x3d, 0x41)
More information about the llvm-commits
mailing list