The current documentation states:
"%X
Output the accumulated linker options specified by -Wl or a ‘%x’ spec string."
The part about -Wl has been obsolete for 27 years, since this change:
Author: Torbjorn Granlund <t...@gnu.org>
Date: Thu Oct 27 18:04:25 1994 +0000
(process_command): Handle -Wl, and -Xlinker similar to -l,
i.e., preserve their order with respect to linker input files.
Technically speaking, the arguments of -l, -Wl and -Xlinker are input files.
Tested on x86-64/Linux, applied on all active branches as obvious.
2021-10-28 Eric Botcazou <ebotca...@adacore.com>
* doc/invoke.texi (%X): Remove obsolete reference to -Wl.
--
Eric Botcazou
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 71992b8c597..f50a990e629 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -32832,8 +32832,7 @@ Substitute the contents of spec string @var{name} at this point.
Accumulate an option for @samp{%X}.
@item %X
-Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
-spec string.
+Output the accumulated linker options specified by a @samp{%x} spec string.
@item %Y
Output the accumulated assembler options specified by @option{-Wa}.