From 0a7dda4f7af1e2911d125726cd3b0ddb42617875 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 16 May 2023 11:19:11 +0100 Subject: -Ur option documentation * ld.texi (-Ur): Clarify the actions of this option. --- ld/ChangeLog | 4 ++++ ld/ld.texi | 20 ++++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index dac58cd575b..788410a026a 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,7 @@ +2023-05-16 Nick Clifton + + * ld.texi (-Ur): Clarify the actions of this option. + 2023-05-10 Nick Clifton PR 16566 diff --git a/ld/ld.texi b/ld/ld.texi index 8038de39106..fdcc8c50e4d 100644 --- a/ld/ld.texi +++ b/ld/ld.texi @@ -1139,14 +1139,18 @@ can be used multiple times to require additional symbols. @kindex -Ur @cindex constructors @item -Ur -For anything other than C++ programs, this option is equivalent to -@samp{-r}: it generates relocatable output---i.e., an output file that can in -turn serve as input to @command{ld}. When linking C++ programs, @samp{-Ur} -@emph{does} resolve references to constructors, unlike @samp{-r}. -It does not work to use @samp{-Ur} on files that were themselves linked -with @samp{-Ur}; once the constructor table has been built, it cannot -be added to. Use @samp{-Ur} only for the last partial link, and -@samp{-r} for the others. + +For programs that do not use constructors or destructors, or for ELF +based systems this option is equivalent to @option{-r}: it generates +relocatable output---i.e., an output file that can in turn serve as +input to @command{ld}. For other binaries however the @option{-Ur} +option is similar to @option{-r} but it also resolves references to +constructors and destructors. + +It does not work to use @option{-Ur} on files that were themselves +linked with @option{-Ur}; once the constructor table has been built, +it cannot be added to. Use @option{-Ur} only for the last partial +link, and @option{-r} for the others. @kindex --orphan-handling=@var{MODE} @cindex orphan sections -- cgit v1.2.1