[PATCH] ld: Support LD_UNDER_TEST environment variable

Andreas Schwab schwab@linux-m68k.org
Sat Mar 16 15:28:13 GMT 2024


On Mär 16 2024, H.J. Lu wrote:

> @@ -64,9 +77,16 @@ remote_exec host "mkdir -p tmpdir"
>  if {[info exists ld_testsuite_bindir]} {
>      set gcc_B_opt "-B$ld_testsuite_bindir/"
>  } else {
> +    if [info exists env(LD_UNDER_TEST)] {
> +	file delete -force tmpdir/ld
> +    }
>      if {![file isdirectory tmpdir/ld]} then {
>  	catch "exec mkdir tmpdir/ld" status
> -	catch "exec ln -s ../../ld-new tmpdir/ld/ld" status
> +	if [info exists env(LD_UNDER_TEST)] {
> +	    catch "exec ln -s $env(LD_UNDER_TEST) tmpdir/ld/ld" status

That won't do the right thing if LD_UNDER_TEST is relative.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


More information about the Binutils mailing list