Skip to contentSkip to conversation

ld01.sh: Relax grep pattern for linker error message

PATCH Applied Wei Gao via ltp 3 participants 3 messages Apr 27 – Apr 28

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ld01.sh: Relax grep pattern for linker error message

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.

---
 testcases/commands/ld/ld01.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/commands/ld/ld01.sh +1 -1
index c8ba4fc1c..a0fbf9631 100755
@@ -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"
Signature · 5 lines
2.52.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Applied
#1 lore raw

Merged, thanks!

Signature · 5 lines
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw

Hi all,

Quoted 1 line

Merged, thanks!

FYI, while checking that error message should contain argv[0] is not much related to ld functionality, but it found a real bug [1] (which I suppose it will be fixed) caused by the alternatives -> libalts switch.

Kind regards,
Petr

[1] https://bugzilla.opensuse.org/show_bug.cgi?id=1262785

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp