ld: Pass -Wl,-z,lazy to compiler for i386 lazy binding tests

Message ID CAMe9rOoD-7-peERkPyDxuG-Pfk+N-OXQ3z6Ny4dB5am7NbnV4Q@mail.gmail.com
State New
Headers
Series ld: Pass -Wl,-z,lazy to compiler for i386 lazy binding tests |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 fail Patch failed to apply

Commit Message

H.J. Lu March 5, 2025, 4:50 a.m. UTC
  Pass -Wl,-z,lazy to compiler for i386 tests which require lazy binding
to support compilers which default to non-lazy binding.

PR ld/32762
* testsuite/ld-i386/i386.exp: Pass -Wl,-z,lazy for
"Build ifunc-1a with PIE -z ibtplt" test.
* testsuite/ld-i386/no-plt.exp: Pass -Wl,-z,lazy for
"Build libno-plt-1b.so", "No PLT (dynamic 1a)",
"No PLT (dynamic 1b)", "No PLT (dynamic 1c)",
"No PLT (PIE 1e)", "No PLT (PIE 1f)", "No PLT (PIE 1g)" tests.
  

Comments

Sam James March 5, 2025, 10:41 p.m. UTC | #1
"H.J. Lu" <hjl.tools@gmail.com> writes:

> Pass -Wl,-z,lazy to compiler for i386 tests which require lazy binding
> to support compilers which default to non-lazy binding.
>
> PR ld/32762
> * testsuite/ld-i386/i386.exp: Pass -Wl,-z,lazy for
> "Build ifunc-1a with PIE -z ibtplt" test.
> * testsuite/ld-i386/no-plt.exp: Pass -Wl,-z,lazy for
> "Build libno-plt-1b.so", "No PLT (dynamic 1a)",
> "No PLT (dynamic 1b)", "No PLT (dynamic 1c)",
> "No PLT (PIE 1e)", "No PLT (PIE 1f)", "No PLT (PIE 1g)" tests.

Thanks.
  

Patch

From 575681ecb75d5392200e26814dc72fdc00cd4527 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Wed, 5 Mar 2025 12:44:11 +0800
Subject: [PATCH] ld: Pass -Wl,-z,lazy to compiler for i386 lazy binding tests

Pass -Wl,-z,lazy to compiler for i386 tests which require lazy binding
to support compilers which default to non-lazy binding.

	PR ld/32762
	* testsuite/ld-i386/i386.exp: Pass -Wl,-z,lazy for
	"Build ifunc-1a with PIE -z ibtplt" test.
	* testsuite/ld-i386/no-plt.exp: Pass -Wl,-z,lazy for
	"Build libno-plt-1b.so", "No PLT (dynamic 1a)",
	"No PLT (dynamic 1b)", "No PLT (dynamic 1c)",
	"No PLT (PIE 1e)", "No PLT (PIE 1f)", "No PLT (PIE 1g)" tests.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
---
 ld/testsuite/ld-i386/i386.exp   |  2 +-
 ld/testsuite/ld-i386/no-plt.exp | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index 8236b8fc0ac..6366457cd08 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -1238,7 +1238,7 @@  if { [isnative]
 	    ] \
 	    [list \
 		"Build ifunc-1a with PIE -z ibtplt" \
-		"-Wl,-z,ibtplt -pie tmpdir/ifunc-1a.o \
+		"-Wl,-z,ibtplt -Wl,-z,lazy -pie tmpdir/ifunc-1a.o \
 		 tmpdir/ifunc-1b.o tmpdir/ifunc-1c.o tmpdir/ifunc-1d.o" \
 		"-Wa,-mx86-used-note=yes" \
 		{ dummy.c } \
diff --git a/ld/testsuite/ld-i386/no-plt.exp b/ld/testsuite/ld-i386/no-plt.exp
index c586960de41..e0b00ba310e 100644
--- a/ld/testsuite/ld-i386/no-plt.exp
+++ b/ld/testsuite/ld-i386/no-plt.exp
@@ -64,7 +64,7 @@  run_cc_link_tests [list \
     ] \
     [list \
 	"Build libno-plt-1b.so" \
-	"-shared tmpdir/no-plt-extern1a.o" \
+	"-shared -Wl,-z,lazy tmpdir/no-plt-extern1a.o" \
 	"-Wa,-mx86-used-note=yes" \
 	{dummy.s} \
 	{{readelf -Wr libno-plt-1b.rd} \
@@ -74,7 +74,7 @@  run_cc_link_tests [list \
     [list \
 	"No PLT (dynamic 1a)" \
 	"$NOPIE_LDFLAGS tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
-	 tmpdir/no-plt-func1.o tmpdir/no-plt-extern1a.o" \
+	 tmpdir/no-plt-func1.o tmpdir/no-plt-extern1a.o -Wl,-z,lazy" \
 	"-Wa,-mx86-used-note=yes" \
 	{dummy.s} \
 	{{readelf -Wr no-plt-1a.rd} {objdump -dwrj.text no-plt-1a.dd}} \
@@ -82,7 +82,7 @@  run_cc_link_tests [list \
     ] \
     [list \
 	"No PLT (dynamic 1b)" \
-	"tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
+	"-Wl,-z,lazy tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
 	 tmpdir/libno-plt-1a.so tmpdir/libno-plt-1b.so" \
 	"-Wa,-mx86-used-note=yes" \
 	{dummy.s} \
@@ -92,7 +92,7 @@  run_cc_link_tests [list \
     [list \
 	"No PLT (dynamic 1c)" \
 	"$NOPIE_LDFLAGS tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
-	 tmpdir/no-plt-func1.o tmpdir/libno-plt-1b.so" \
+	 tmpdir/no-plt-func1.o tmpdir/libno-plt-1b.so -Wl,-z,lazy" \
 	"-Wa,-mx86-used-note=yes" \
 	{dummy.s} \
 	{{readelf -Wr no-plt-1c.rd} {objdump -dwrj.text no-plt-1c.dd}} \
@@ -109,7 +109,7 @@  run_cc_link_tests [list \
     ] \
     [list \
 	"No PLT (PIE 1e)" \
-	"-pie tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
+	"-pie -Wl,-z,lazy tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
 	 tmpdir/no-plt-func1.o tmpdir/no-plt-extern1a.o" \
 	"-Wa,-mx86-used-note=yes" \
 	{dummy.s} \
@@ -118,7 +118,7 @@  run_cc_link_tests [list \
     ] \
     [list \
 	"No PLT (PIE 1f)" \
-	"-pie tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
+	"-pie -Wl,-z,lazy tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
 	 tmpdir/libno-plt-1a.so tmpdir/libno-plt-1b.so" \
 	"-Wa,-mx86-used-note=yes" \
 	{ dummy.s } \
@@ -127,7 +127,7 @@  run_cc_link_tests [list \
     ] \
     [list \
 	"No PLT (PIE 1g)" \
-	"-pie tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
+	"-pie -Wl,-z,lazy tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
 	 tmpdir/no-plt-func1.o tmpdir/libno-plt-1b.so" \
 	"-Wa,-mx86-used-note=yes" \
 	{ dummy.s } \
-- 
2.48.1