All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v1] ld01.sh: Relax grep pattern for linker error message
@ 2026-04-27  0:56 Wei Gao via ltp
  2026-04-27  2:41 ` Li Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Gao via ltp @ 2026-04-27  0:56 UTC (permalink / raw)
  To: ltp

The test was failing on systems (like openSUSE-Tumbleweed) where the
linker identifies itself as '/usr/bin/ld.bfd:' instead of the expected
'ld:'.

ld01 5 TPASS: ld -Bdynamic -shared main.o f1.o rf1.o -o test.so -L/usr/lib/ passed as expected
ld01 5 TPASS: ld -Bstatic -r main.o f1.o rf1.o test.so -L/usr/lib/ 2> ld.out failed as expected
/usr/bin/ld.bfd: attempted static link of dynamic object `test.so'
ld01 5 TFAIL: Unexpected error message

Relax the grep pattern to search for the core error message
'attempted static link of dynamic object' without requiring the
binary name prefix.

Signed-off-by: Wei Gao <wegao@suse.com>
---
 testcases/commands/ld/ld01.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/commands/ld/ld01.sh b/testcases/commands/ld/ld01.sh
index c8ba4fc1c..a0fbf9631 100755
--- a/testcases/commands/ld/ld01.sh
+++ b/testcases/commands/ld/ld01.sh
@@ -69,7 +69,7 @@ test5()
 	EXPECT_FAIL $LD -Bstatic -r main.o f1.o rf1.o test.so -L/usr/lib/ 2\> ld.out
 	cat ld.out
 
-	if grep -q "$LD: attempted static link of dynamic object" ld.out; then
+	if grep -q "attempted static link of dynamic object" ld.out; then
 		tst_res TPASS "Got expected error message"
 	else
 		tst_res TFAIL "Unexpected error message"
-- 
2.52.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-28 12:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-27  0:56 [LTP] [PATCH v1] ld01.sh: Relax grep pattern for linker error message Wei Gao via ltp
2026-04-27  2:41 ` Li Wang
2026-04-28 12:07   ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.