From nobody Tue Jun 17 19:01:36 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bMGSK1FRSz5VpGD; Tue, 17 Jun 2025 19:01:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bMGSJ61Rpz3q0c; Tue, 17 Jun 2025 19:01:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750186896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wzbe8DauI0rFhQtrN1QqjlVtZ0JP3T8zAWSNBNWyItQ=; b=BGdaWGAxgX+ThAQujWo/UyyvjsUsqrc+noD6UR+KIFpPNMHtwR/8K13dm/Dnfeqiv8Hbo7 vk72QeY4FThdIWnBRBzDxMxI3ba0H9BrMG630ynohe0JpIjYdJWptfwONg4SReRejUFNHB Q0MD46sH4XrXtSRlKSBUpbmDQbYFJurVLI26A2ZQ25Le26Bi4VW2mltm3ISNNsWRruZt4r oDDSMz2GV+ZHmCuQFYwtHw3T7HYFtbG5WTZpdgIaDtzhnkPN9x3BTRgm8A1s+NxDBRx3bV dPT+Bs4qr/HeLI1gqIhYpgEWXipU+VTOsbZQNnSALl12DWoxQ4WELDzOj9X00A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750186896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wzbe8DauI0rFhQtrN1QqjlVtZ0JP3T8zAWSNBNWyItQ=; b=CTu1zLzou7acahzTvoEM81Fol2j+en6TOXgPO7jzosyFULK62BquXPmz9rBt0ZgH9eZMis ELHq9VEUUCfEOzftc5SAN5gGF4IUKXoqwR/avoRvcOyqVy8hheVzx4jjyR3ldFZkX0wWlK VrmMbVdBFnixrUNazC7MmwsrnPQXmF/yIHwOKQJ+0RUD1oBMjm3jIWvpUnSDT6EThJhJio h4Cjy2JL4WEzmMV5BivZTEOColAWktikMU/WsFkA3rPMx/USseiZ2UHAcRs32UCmDyOuOb Ch5CyyS6NTS2eD9McTErD5F500ti+n2gDfUgLKQ4B6tSGi5XQus7XdipL8o9ZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750186896; a=rsa-sha256; cv=none; b=f8chMpPRPp7Cj9b59qgf06QO6VdMGYSn01OKoYK7pFegYwKAolZGl2zdiee22IMLYesWtA sjUqlWJ4xrofcIZebo8XUWZUAHKWxCOc9VwLhlKbreAc0gUqhzcQ2BWi7KD4FTq7/72LL+ Sr8hSAKyz+FaSJTch9ZpJs4cvHCrIbOtm/SEMkiKRIF5NGnpHemA/BN9ZAmNUv3b7cMdzI NBHN193awHl5WOJA6FFAttHO9i98ok9gstmTzwb8sHt1Vop4s9LdjHGsBBNqefkOpNtPZf FT3KsHCu/5gs5MenQB03b0nS/OS1X6kY0ZEFcCaLUGJeUUfzM4dY8xQ+S/HSYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bMGSJ54Q8zwrG; Tue, 17 Jun 2025 19:01:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55HJ1aZW012905; Tue, 17 Jun 2025 19:01:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55HJ1aKt012902; Tue, 17 Jun 2025 19:01:36 GMT (envelope-from git) Date: Tue, 17 Jun 2025 19:01:36 GMT Message-Id: <202506171901.55HJ1aKt012902@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 2c2edbe9acf7 - stable/14 - elf.5: Document .init_array and .fini_array List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2c2edbe9acf7f22b6ff4cdb3f9c280155c67c46e Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2c2edbe9acf7f22b6ff4cdb3f9c280155c67c46e commit 2c2edbe9acf7f22b6ff4cdb3f9c280155c67c46e Author: Ed Maste AuthorDate: 2025-05-16 16:20:10 +0000 Commit: Ed Maste 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