[binutils-gdb] ld: move symlink-ing of ldscripts a little earlier

Jan Beulich jbeulich@sourceware.org
Fri Feb 13 09:22:45 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6c625668326b342247791f47492756c643010eb7

commit 6c625668326b342247791f47492756c643010eb7
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri Feb 13 10:19:23 2026 +0100

    ld: move symlink-ing of ldscripts a little earlier
    
    Following up commit a29a6230b820 "PR 33629 ldscripts symlink in .libs/
    created too late", move the symlink-ing ahead of the linking of the final
    binary, to eliminate the slim chance of the build being interrupted (or
    failing) at that (so far) final step. If that happened, a subsequent make
    invocation with no other changes made would then not re-attempt this step.
    
    Necessarily with this the test for the existence of the binary needs to be
    removed. Perhaps that shouldn't have been there anyway, the more that the
    check was lacking $(EXEEXT).

Diff:
---
 ld/Makefile.am | 2 +-
 ld/Makefile.in | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ld/Makefile.am b/ld/Makefile.am
index a81cb4578bc..20d17c23f33 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -661,8 +661,8 @@ EXTRA_ld_new_SOURCES += $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES)
 # The standard rule plus set up a symlink when --enable-shared for "make check"
 ld-new$(EXEEXT): $(ld_new_OBJECTS) $(ld_new_DEPENDENCIES) $(EXTRA_ld_new_DEPENDENCIES)
 	@rm -f ld-new$(EXEEXT)
+	$(AM_V_at)cd .libs; test -e ldscripts || $(LN_S) ../ldscripts .
 	$(AM_V_CCLD)$(LINK) $(ld_new_OBJECTS) $(ld_new_LDADD) $(LIBS)
-	$(AM_V_at)cd .libs; test ! -e ld-new || test -e ldscripts || $(LN_S) ../ldscripts .
 
 # This is the real libbfd.a and libctf.a created by libtool.
 TESTBFDLIB = @TESTBFDLIB@
diff --git a/ld/Makefile.in b/ld/Makefile.in
index 9de1ec5f676..ddc2732a03f 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -2370,8 +2370,8 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS)
 # The standard rule plus set up a symlink when --enable-shared for "make check"
 ld-new$(EXEEXT): $(ld_new_OBJECTS) $(ld_new_DEPENDENCIES) $(EXTRA_ld_new_DEPENDENCIES)
 	@rm -f ld-new$(EXEEXT)
+	$(AM_V_at)cd .libs; test -e ldscripts || $(LN_S) ../ldscripts .
 	$(AM_V_CCLD)$(LINK) $(ld_new_OBJECTS) $(ld_new_LDADD) $(LIBS)
-	$(AM_V_at)cd .libs; test ! -e ld-new || test -e ldscripts || $(LN_S) ../ldscripts .
 
 check-DEJAGNU: site.exp
 	srcroot=`cd $(srcdir) && pwd`; export srcroot; \


More information about the Binutils-cvs mailing list