https://gcc.gnu.org/g:060af69489000c456cc9bd2530e933a1aa6fc4a8
commit r16-5134-g060af69489000c456cc9bd2530e933a1aa6fc4a8 Author: Sandra Loosemore <[email protected]> Date: Wed Oct 29 22:11:44 2025 +0000 Document linker options + -Q and -S [PR122243] This patch adds documentation for several options that the GCC driver passes to the linker via specs without further interpretation. I've also added some comments/documentation strings to common.opt for these and a couple other options that previously didn't have any. gcc/ChangeLog PR other/122243 * common.opt: Add comments/documentation for -N, -Q, -S, -T, -Tbss, -Tdata, -Ttext, -Z, -n, -Q, -s, -t, -z. * doc/invoke.texi: Add documentation for -Tbss, -Tdata, -Ttext, -N, -n, -t, -Z. Diff: --- gcc/common.opt | 20 +++++++++++++++++++- gcc/doc/invoke.texi | 25 ++++++++++++++++++++----- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/gcc/common.opt b/gcc/common.opt index 9cbd2d8a7945..cb8732d9336c 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -457,6 +457,7 @@ Driver Joined Separate N Driver +Passed to the linker. O Common JoinedOrMissing Optimization @@ -478,8 +479,10 @@ Oz Common Optimization Optimize for space aggressively rather than speed. +; Driver passes -quiet to the front end if -Q is not specified. Q Driver +-Q --help prints what options are enabled. Just -Q enables verbose messages. Qn Driver Negative(Qy) @@ -492,27 +495,35 @@ Driver Joined Separate S Driver +Stop processing after generating assembly code; do not assemble. T Driver Joined Separate +Passed to the linker. Tbss Driver Separate +Passed to the linker. Tbss= Driver Joined +Passed to the linker. Tdata Driver Separate +Passed to the linker. Tdata= Driver Joined +Passed to the linker. Ttext Driver Separate +Passed to the linker. Ttext= Driver Joined +Passed to the linker. W Common RejectNegative Warning Alias(Wextra) @@ -929,6 +940,7 @@ Driver Separate Z Driver +Passed to the linker. aux-info Common Separate Var(aux_info_file_name) @@ -3827,6 +3839,7 @@ Driver Joined Separate n Driver +Passed to the linker. no-canonical-prefixes Driver @@ -3900,15 +3913,18 @@ Driver Var(print_sysroot) print-sysroot-headers-suffix Driver Var(print_sysroot_headers_suffix) +; The driver doesn't understand -quiet, only its inverse -Q. quiet -Common Var(quiet_flag) RejectDriver +Common Var(quiet_flag) RejectDriver Undocumented Do not display functions compiled or elapsed time. r Driver +Produce a relocatable object as output. s Driver +Remove all symbol table and relocation information from the executable. save-temps Driver @@ -3918,6 +3934,7 @@ Driver Joined t Driver +Passed to the linker. time Driver Var(report_times) @@ -4028,6 +4045,7 @@ Create a static position independent executable. z Driver Joined Separate +Passed to the linker. fipa-ra Common Var(flag_ipa_ra) Optimization diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 809bbc61b337..887a54e947e2 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -777,7 +777,9 @@ Objective-C and Objective-C++ Dialects}. -static-libasan -static-libtsan -static-liblsan -static-libubsan -shared -shared-libgcc -symbolic -T @var{script} -Wl,@var{option} -Xlinker @var{option} --u @var{symbol} -z @var{keyword} +-u @var{symbol} +-Tbss=@var{addr} -Tdata=@var{addr} -Ttext=@var{addr} +-N -n -t -Z -z @var{keyword} --entry=@var{entry} --for-linker=@var{option} --force-link=@var{symbol} --no-standard-library --pie --static --static-pie --symbolic} @@ -20081,11 +20083,24 @@ Pretend the symbol @var{symbol} is undefined, to force linking of library modules to define it. You can use @option{-u} multiple times with different symbols to force loading of additional library modules. +@opindex Tbss +@opindex Tdata +@opindex Ttext +@opindex N +@opindex n +@opindex t +@opindex Z @opindex z -@item -z @var{keyword} -@option{-z} is passed directly on to the linker along with the keyword -@var{keyword}. See the section in the documentation of your linker for -permitted values and their meanings. +@item -Tbss=@var{addr} +@itemx -Tdata=@var{addr} +@itemx -Ttext=@var{addr} +@itemx -N +@itemx -n +@itemx -t +@itemx -Z +@itemx -z @var{keyword} +These options are passed through to the linker without interpretation by GCC. +Refer to your linker documentation for the meanings of these options. @end table @node Directory Options
