git: 2c2edbe9acf7 - stable/14 - elf.5: Document .init_array and .fini_array
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 17 Jun 2025 19:01:36 UTC
The branch stable/14 has been updated by emaste:
URL: https://cgit.FreeBSD.org/src/commit/?id=2c2edbe9acf7f22b6ff4cdb3f9c280155c67c46e
commit 2c2edbe9acf7f22b6ff4cdb3f9c280155c67c46e
Author: Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2025-05-16 16:20:10 +0000
Commit: Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-06-17 19:01:18 +0000
elf.5: Document .init_array and .fini_array
And note that .init and .fini are legacy interfaces.
Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50380
(cherry picked from commit 4eabcb77d5bbf418aa86efae6523375d28150d4d)
---
share/man/man5/elf.5 | 33 ++++++++++++++++++++++++++++++---
1 file changed, 30 insertions(+), 3 deletions(-)
diff --git a/share/man/man5/elf.5 b/share/man/man5/elf.5
index 2aebd1b27702..bda2020b2d5d 100644
--- a/share/man/man5/elf.5
+++ b/share/man/man5/elf.5
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd July 25, 2022
+.Dd May 24, 2025
.Dt ELF 5
.Os
.Sh NAME
@@ -915,7 +915,7 @@ This section is of type
The attribute used is
.Sy SHF_ALLOC .
.It .fini
-This section holds executable instructions that contribute to the process
+This legacy section holds executable instructions that contribute to the process
termination code.
When a program exits normally the system arranges to
execute the code in this section.
@@ -925,6 +925,19 @@ The attributes used are
.Sy SHF_ALLOC
and
.Sy SHF_EXECINSTR .
+.It .fini_array
+This section holds pointers to finalization routines.
+When a program exits normally
+.Xr rtld 1
+executes the code referenced by this section.
+This section is of type
+.Sy SHT_FINI_ARRAY .
+The attributes used are
+.Sy SHF_ALLOC .
+Refer to
+.Dv NT_FREEBSD_NOINIT_TAG
+.Pq below
+for a description of how initialization and finalization code is invoked.
.It .got
This section holds the global offset table.
This section is of type
@@ -937,7 +950,7 @@ This section is of type
The attribute used is
.Sy SHF_ALLOC .
.It .init
-This section holds executable instructions that contribute to the process
+This legacy section holds executable instructions that contribute to the process
initialization code.
When a program starts to run the system arranges to
execute the code in this section before calling the main program entry point.
@@ -947,6 +960,20 @@ The attributes used are
.Sy SHF_ALLOC
and
.Sy SHF_EXECINSTR .
+.It .init_array
+This section holds pointers to initialization routines.
+When a program starts to run
+.Xr rtld 1
+executes the code referenced by this section before calling the program entry
+point.
+This section is of type
+.Sy SHT_INIT_ARRAY .
+The attributes used are
+.Sy SHF_ALLOC .
+Refer to
+.Dv NT_FREEBSD_NOINIT_TAG
+.Pq below
+for a description of how initialization and finalization code is invoked.
.It .interp
This section holds the pathname of a program interpreter.
If the file has