From nobody Sat May 24 15:44:33 2025 X-Original-To: dev-commits-src-main@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 4b4RD16tjGz5wZnj; Sat, 24 May 2025 15:44:33 +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 4b4RD15dTVz3RMk; Sat, 24 May 2025 15:44:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748101473; 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=yPXUAM4yY7PJ984OVFg74qzHf3ljyeOigOYFyKgEFZE=; b=bkRam0rrmI0Oy0vobKa+ROuZh9GCXJYsqsyqqLJkoAEiUXFmdAknMYoIRKjysKAKuwy64e gNL8jffJfkr190jhwTmjdpuZGVzehCBIvXOFpia/oCqXolGot65ki0Z1oK8XAKdo8KHnCn yFXpD6hjFhmIgE2RMSGJWuew7dxDvUdVkcuEkpyqtiadgZ/PsKZAF8vbCtjqMKYCzin2ms gdsge8mV7ARX7ka5L3XUxf3piyH1L2+bz3DeYNm29UfIgU0qhhjZ8f9JXxCc8RvI2gYkhD U2kytGIwb9temZUnwu4x6hCNXs8MCu+p+YME1FMB4+ZC+FndRVILuBMx9Cd77w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748101473; 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=yPXUAM4yY7PJ984OVFg74qzHf3ljyeOigOYFyKgEFZE=; b=dwfSSb8VSJDDRMDWyKKi+cOhisRGd6AXJL4es32QemmgirVjK9kzjpPc94Ksp1UGjcRJJ8 O9TLnEWJ1f7ejepHmfAP2TBdbiskSsJoAAff+ZvzjqhPa2DoHD/BxYSq4NytjcD+6cVrki oYbOHwegZOtqDg5Cqu2kHIpuxqFIgi/+IySBD3D9G9UVkB8MhqYmezeJbcXoP/RPGaU3cT 7/Tq2lTzL0bjfFkQ5DIDKWbydQWhmUIVYOsweTJNvD9AqtvpKy5XZkUYhFZNg6uQB73EtN JJePHeu3GxfRV3iKq12Knihsjpt0LqEaBBgm95VamL34iZdbV4h1UEYZ8FvfQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748101473; a=rsa-sha256; cv=none; b=m5X56b2ArVZwVC8m+OIRBUbZU85jrGJILqBHkpfvs/z6fOOJkpOLlq84jBmAcG+ts2fDn5 0iZNw/01CobS1vd+xZteZsZ210lm+Jd+oKraey5G3HcLirE/p5Xy8yjamBYPaEkSDf6kh4 3qWh1xijtw+2CCtBt9EI6lLpIxUb7CRM9eGpozRacQFIkPHex4oUyIGyPveu2JsQie4ZT5 LKf/tkxlt/VLlWsKLE6dYYoqActmMROAYkXrHU4q8vijlLAZVxNmuDZHnAAzZNK7TPDLHz uIQWOCRMFcak6+TJNWOZ5NujZeEcsbeeIU9R1FhlgkMNQ4fE02NyjFHl+qQkUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4b4RD14xwwzjRk; Sat, 24 May 2025 15:44:33 +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 54OFiXxg042328; Sat, 24 May 2025 15:44:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54OFiXS0042325; Sat, 24 May 2025 15:44:33 GMT (envelope-from git) Date: Sat, 24 May 2025 15:44:33 GMT Message-Id: <202505241544.54OFiXS0042325@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 4eabcb77d5bb - main - elf.5: Document .init_array and .fini_array List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 4eabcb77d5bbf418aa86efae6523375d28150d4d Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4eabcb77d5bbf418aa86efae6523375d28150d4d commit 4eabcb77d5bbf418aa86efae6523375d28150d4d Author: Ed Maste AuthorDate: 2025-05-16 16:20:10 +0000 Commit: Ed Maste CommitDate: 2025-05-24 15:43:34 +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 --- 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 bd12f5e52df0..5f1aad2298c0 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 May 20, 2025 +.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