From 95124b124684fece31ecba687478878aa609756b Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Thu, 15 Mar 2012 18:10:40 +0100 Subject: [PATCH] Accept libraries which end with a character (e.g. .so.0d). --- bin/blhc | 2 +- t/logs/bad-library | 2 ++ t/logs/good-library | 2 ++ t/tests.t | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/blhc b/bin/blhc index b99e7dc..d662283 100755 --- a/bin/blhc +++ b/bin/blhc @@ -279,7 +279,7 @@ foreach my $line (@input) { [\s\\]*\s+ # possible line continuation ([A-Za-z0-9_/.-]+/)? # path to file [A-Za-z0-9_-]+ # binary name (no dots!) - (\.so([0-9.])*|\.la)? # library (including version) + (\.so[0-9.]*[a-z]?|\.la)? # library (including version) (\s|\\|\$) # end of file name }x or $line =~ /^libtool: link: / diff --git a/t/logs/bad-library b/t/logs/bad-library index 042c58d..8ddd78c 100644 --- a/t/logs/bad-library +++ b/t/logs/bad-library @@ -3,3 +3,5 @@ gcc -shared -fPIC -DPIC libtest.o -lpthread -O2 -Wl,relro -Wl,--as-needed -o lib gcc -shared -fPIC -DPIC libtest.o -lpthread -O2 -Wl,--as-needed -o libtest.so gcc -shared -fPIC test.o -Wl,-z -Wl,relro -o .libs/libtest.so.1.0.0 + +gcc -shared -o libtest.so.0d ./test-a.o test/./test-b.o -Wl,-z,now -lpthread -ldl diff --git a/t/logs/good-library b/t/logs/good-library index c077840..76d461f 100644 --- a/t/logs/good-library +++ b/t/logs/good-library @@ -4,3 +4,5 @@ gcc -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wfor gcc -shared -fPIC -DPIC libtest.o -lpthread -O2 -Wl,relro -Wl,now -Wl,--as-needed -o libtest.so gcc -shared -fPIC test.o -Wl,-z -Wl,relro -Wl,now -o .libs/libtest.so.1.0.0 + +gcc -shared -fPIE -pie -o libtest.so.0d ./test-a.o test/./test-b.o -Wl,-z,relro -Wl,-z,now -lpthread -ldl diff --git a/t/tests.t b/t/tests.t index 0509a97..2aea3be 100644 --- a/t/tests.t +++ b/t/tests.t @@ -287,6 +287,7 @@ is_blhc 'bad-library', '--all', 4, LDFLAGS missing (-Wl,-z,now): gcc -shared -fPIC -DPIC libtest.o -lpthread -O2 -Wl,relro -Wl,--as-needed -o libtest.so LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -shared -fPIC -DPIC libtest.o -lpthread -O2 -Wl,--as-needed -o libtest.so LDFLAGS missing (-Wl,-z,now): gcc -shared -fPIC test.o -Wl,-z -Wl,relro -o .libs/libtest.so.1.0.0 +LDFLAGS missing (-Wl,-z,relro -fPIE -pie): gcc -shared -o libtest.so.0d ./test-a.o test/./test-b.o -Wl,-z,now -lpthread -ldl "; -- 2.45.2