ld: Properly create a symbolic link to tmpdir/ldscripts

Message ID 20210423175529.320669-1-hjl.tools@gmail.com
State New
Headers show
Series
  • ld: Properly create a symbolic link to tmpdir/ldscripts
Related show

Commit Message

Luis Machado via Binutils April 23, 2021, 5:55 p.m.
Don't create a symbolic link to tmpdir/ldscripts if it exists.

	PR ld/27771
	* testsuite/ld-bootstrap/bootstrap.exp: Create a symbolic link
	to tmpdir/ldscripts only if it doesn't exist.
---
 ld/testsuite/ld-bootstrap/bootstrap.exp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
2.30.2

Patch

diff --git a/ld/testsuite/ld-bootstrap/bootstrap.exp b/ld/testsuite/ld-bootstrap/bootstrap.exp
index 2e4a09704ab..b21b48ab20e 100644
--- a/ld/testsuite/ld-bootstrap/bootstrap.exp
+++ b/ld/testsuite/ld-bootstrap/bootstrap.exp
@@ -62,7 +62,9 @@  if { [istarget "powerpc-*-*"] } {
 
 set gcc_B_opt_save $gcc_B_opt
 
-catch "exec ln -s ../ldscripts tmpdir/ldscripts" status
+if {![file exists tmpdir/ldscripts]} then {
+    catch "exec ln -s ../ldscripts tmpdir/ldscripts" status
+}
 foreach ldexe {ld1 ld2 ld3} {
     if {![file isdirectory tmpdir/gcc$ldexe]} then {
 	catch "exec mkdir tmpdir/gcc$ldexe" status