aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2025-01-11 07:23:27 +0800
committerH.J. Lu <hjl.tools@gmail.com>2025-01-14 05:22:04 +0800
commit7d10ff50bd56cf780145a3f6e10fee3558620a8f (patch)
tree29db1498ddc0d614a146cfa777f773e3b83ecd6c
parent9b854f169df9b9853dc7284114beca8d8ab4f99f (diff)
downloadbinutils-7d10ff50bd56cf780145a3f6e10fee3558620a8f.zip
binutils-7d10ff50bd56cf780145a3f6e10fee3558620a8f.tar.gz
binutils-7d10ff50bd56cf780145a3f6e10fee3558620a8f.tar.bz2
ld: Document mixing LTO and non-LTO objects for -r
* ld.texi: Document mixing LTO and non-LTO relocatable files for "ld -r". Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
-rw-r--r--ld/ld.texi12
1 files changed, 12 insertions, 0 deletions
diff --git a/ld/ld.texi b/ld/ld.texi
index da714a2..d178745 100644
--- a/ld/ld.texi
+++ b/ld/ld.texi
@@ -1126,6 +1126,18 @@ relocations. Different output formats can have further restrictions; for
example some @code{a.out}-based formats do not support partial linking
with input files in other formats at all.
+On ELF platforms, when the relocatable output contains both contents
+which require link-time optimization (LTO) and contents which don't
+require LTO, a .gnu_object_only section will be created to contain a
+relocatable object file, as if @samp{-r} is applied to all relocatable
+inputs which don't require LTO. When processing a relocatable input
+with a .gnu_object_only section, the linker will extract the
+.gnu_object_only section as a separate input.
+
+Note that since @samp{-r} groups some sections from different input files
+together, there may be negative impacts on code size and locality in
+final executable or shared library.
+
This option does the same thing as @samp{-i}.
@kindex -R @var{file}