[PATCH v3 2/4] ld: Document mixing IR and non-IR objects for -r

H.J. Lu hjl.tools@gmail.com
Sun Jan 12 07:07:50 GMT 2025


	* ld.texi: Document mixing IR and non-IR relocatable files for
	"ld -r".

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
---
 ld/ld.texi | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/ld/ld.texi b/ld/ld.texi
index da714a20855..f8a3f9df13a 100644
--- a/ld/ld.texi
+++ b/ld/ld.texi
@@ -1126,6 +1126,17 @@ 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 IR and
+non-IR contents, a .gnu_object_only section will be created to contain
+a relocatable object file, as if @samp{-r} is applied to all non-IR
+relocatable inputs.  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}
-- 
2.47.1



More information about the Binutils mailing list