public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/1] commands/ld01: Fix shared library detection on file >= 5.33
@ 2019-01-23  9:11 Petr Vorel
  2019-01-25 14:46 ` Petr Vorel
  0 siblings, 1 reply; 2+ messages in thread
From: Petr Vorel @ 2019-01-23  9:11 UTC (permalink / raw)
  To: ltp

Since commit 6876ebad ("add a conditional in description") in file util
shared library is described as "LSB pie executable", thus check for it
as well.

+ do more precise check for old versions ('shared object').

NOTE: we compile with -fPIC, but file detects pie even if we disable it:
$CC -no-pie -c -o rf1.o /opt/ltp/testcases/data/ld01/rf1.c
$CC -no-pie -c -o f1.o /opt/ltp/testcases/data/ld01/f1.c
$CC -no-pie -c -o rd1.o /opt/ltp/testcases/data/ld01/rd1.c
$CC -no-pie -c -o d1.o /opt/ltp/testcases/data/ld01/d1.c
$CC -no-pie -c -o main.o /opt/ltp/testcases/data/ld01/main.c
ld -no-pie -shared f1.o d1.o -o test.so

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/commands/ld/ld01 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/commands/ld/ld01 b/testcases/commands/ld/ld01
index f24f6f97e..986ad1e60 100755
--- a/testcases/commands/ld/ld01
+++ b/testcases/commands/ld/ld01
@@ -67,7 +67,7 @@ test3()
 {
 	EXPECT_PASS $LD -shared f1.o d1.o -o test.so
 
-	if file test.so |grep -q shared; then
+	if file test.so |grep -q -e 'pie executable' -e 'shared object'; then
 		tst_res TPASS "Shared library could be build"
 	else
 		tst_res TFAIL "Failed to build shared library"
-- 
2.19.2


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

* [LTP] [PATCH 1/1] commands/ld01: Fix shared library detection on file >= 5.33
  2019-01-23  9:11 [LTP] [PATCH 1/1] commands/ld01: Fix shared library detection on file >= 5.33 Petr Vorel
@ 2019-01-25 14:46 ` Petr Vorel
  0 siblings, 0 replies; 2+ messages in thread
From: Petr Vorel @ 2019-01-25 14:46 UTC (permalink / raw)
  To: ltp

Hi,

> Since commit 6876ebad ("add a conditional in description") in file util
> shared library is described as "LSB pie executable", thus check for it
> as well.

> + do more precise check for old versions ('shared object').

FYI merged.

Kind regards,
Petr

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

end of thread, other threads:[~2019-01-25 14:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-23  9:11 [LTP] [PATCH 1/1] commands/ld01: Fix shared library detection on file >= 5.33 Petr Vorel
2019-01-25 14:46 ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox