ld: Build libpr23169a.so with -z lazy

Message ID 20230807172603.33596-1-hjl.tools@gmail.com
State Accepted
Headers
Series ld: Build libpr23169a.so with -z lazy |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

H.J. Lu Aug. 7, 2023, 5:26 p.m. UTC
  pr23169b test only works with lazy binding.  To work with linker which
disables lazy binding by default, build pr23169b binaries with -z lazy.

	PR ld/30698
	* ld-ifunc/ifunc.exp: Build pr23169b binaries with -z lazy.
---
 ld/testsuite/ld-ifunc/ifunc.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

H.J. Lu Aug. 14, 2023, 3:42 p.m. UTC | #1
On Mon, Aug 7, 2023 at 10:26 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> pr23169b test only works with lazy binding.  To work with linker which
> disables lazy binding by default, build pr23169b binaries with -z lazy.
>
>         PR ld/30698
>         * ld-ifunc/ifunc.exp: Build pr23169b binaries with -z lazy.
> ---
>  ld/testsuite/ld-ifunc/ifunc.exp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/ld/testsuite/ld-ifunc/ifunc.exp b/ld/testsuite/ld-ifunc/ifunc.exp
> index edabcc3f744..2bf656e73b2 100644
> --- a/ld/testsuite/ld-ifunc/ifunc.exp
> +++ b/ld/testsuite/ld-ifunc/ifunc.exp
> @@ -604,7 +604,7 @@ run_cc_link_tests [list \
>      ] \
>      [list \
>         "Build libpr23169a.so" \
> -       "-shared" \
> +       "-shared -Wl,-z,lazy" \
>         "-fPIC -O2 -g" \
>         { pr23169a.c } \
>         {} \
> @@ -751,7 +751,7 @@ run_ld_link_exec_tests [list \
>      ] \
>      [list \
>         "Run pr23169b" \
> -       "-pie -Wl,--no-as-needed tmpdir/libpr23169a.so" \
> +       "-pie -Wl,--no-as-needed,-z,lazy tmpdir/libpr23169a.so" \
>         "" \
>         { pr23169b.c pr23169c.c } \
>         "pr23169b" \
> --
> 2.41.0
>

I am checking it in.
  

Patch

diff --git a/ld/testsuite/ld-ifunc/ifunc.exp b/ld/testsuite/ld-ifunc/ifunc.exp
index edabcc3f744..2bf656e73b2 100644
--- a/ld/testsuite/ld-ifunc/ifunc.exp
+++ b/ld/testsuite/ld-ifunc/ifunc.exp
@@ -604,7 +604,7 @@  run_cc_link_tests [list \
     ] \
     [list \
 	"Build libpr23169a.so" \
-	"-shared" \
+	"-shared -Wl,-z,lazy" \
 	"-fPIC -O2 -g" \
 	{ pr23169a.c } \
 	{} \
@@ -751,7 +751,7 @@  run_ld_link_exec_tests [list \
     ] \
     [list \
 	"Run pr23169b" \
-	"-pie -Wl,--no-as-needed tmpdir/libpr23169a.so" \
+	"-pie -Wl,--no-as-needed,-z,lazy tmpdir/libpr23169a.so" \
 	"" \
 	{ pr23169b.c pr23169c.c } \
 	"pr23169b" \