[PATCH] ld: Append LDFLAGS to flags variable in default_ld_link

Alan Modra amodra@gmail.com
Thu Apr 30 10:55:35 GMT 2026


On Wed, Apr 29, 2026 at 11:57:36AM -0400, John David Anglin wrote:
> On 2026-04-28 10:18 p.m., Alan Modra wrote:
> > On Mon, Apr 27, 2026 at 11:30:57AM -0400, John David Anglin wrote:
> >> ld/ChangeLog:
> >>
> >> 	* testsuite/lib/ld-lib.exp (default_ld_link): Append
> >> 	LDFLAGS to `flags' variable.  Also use the append command
> >> 	to append the board flags.
> > 
> > OK, thanks.
> 
> After Maciej's last comments, I had updated the change to remove references
> to LDFLAGS from `run_ld_link_tests'.  But after inspecting the following commit
> https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=740341b9be657772538f9cf0b563c49798f47b3c
> it seemed that LDFLAGS was intentionally not added to the flags variable in default_ld_link.
> In that change, checks.exp and a number of other .exp files were updated to pass LDFLAGS
> to ld.  Maybe it would be safer to update the .exp files that don't currently pass
> LDFLAGS to ld as that seems to be the current practice?

That was likely why I did it that way, but if you need all occurrences
of ld_link to use LDFLAGS then I'm happy for you to put it in
default_ld_link, and ideally remove the then unnecessary places I
added LDFLAGS.

> 
> Dave
> -- 
> John David Anglin  dave.anglin@bell.net

-- 
Alan Modra


More information about the Binutils mailing list