[4/4] ld: Document --text-section-ordering-file FILE

Message ID 20240119194552.1255481-5-hjl.tools@gmail.com
State Unresolved
Headers
Series None |

Checks

Context Check Description
snail/binutils-gdb-check warning Git am fail log

Commit Message

H.J. Lu Jan. 19, 2024, 7:45 p.m. UTC
  --text-section-ordering-file FILE is supported only in ELF and PE COFF
linkers which support input .text.* sections.

	* NEWS: Mention --text-section-ordering-file FILE.
	* ld.texi: Document text-section-ordering-file FILE.
---
 ld/NEWS    |  3 +++
 ld/ld.texi | 11 +++++++++++
 2 files changed, 14 insertions(+)
  

Patch

diff --git a/ld/NEWS b/ld/NEWS
index c3ebe320e5e..c98570f308a 100644
--- a/ld/NEWS
+++ b/ld/NEWS
@@ -1,5 +1,8 @@ 
 -*- text -*-
 
+* Add the linker option, --text-section-ordering-file FILE, for ELF and
+  PE COFF linker to specify the input text section order.
+
 Changes in 2.42:
 
 * Add -z mark-plt/-z nomark-plt options to x86-64 ELF linker to mark PLT
diff --git a/ld/ld.texi b/ld/ld.texi
index 4fda259a552..d1bb59202de 100644
--- a/ld/ld.texi
+++ b/ld/ld.texi
@@ -2541,6 +2541,17 @@  patterns in the linker script.
 This option will apply @code{SORT_BY_ALIGNMENT} to all wildcard section
 patterns in the linker script.
 
+@kindex text-section-ordering-file=@file{file}
+@item text-section-ordering-file=@file{file}
+This option groups input text sections together in the order specified
+in the file which contains the list of text section wildcards starting
+with @code{.}, separated by whitespace.
+
+If the @option{verbose} option is enabled, the contents of the text
+section ordering file will be reported.
+
+This option is supported only in ELF and PE COFF linkers.
+
 @kindex --spare-dynamic-tags
 @item --spare-dynamic-tags=@var{count}
 This option specifies the number of empty slots to leave in the