From owner-svn-src-stable@freebsd.org Sat Oct 31 11:56:14 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6586444990A; Sat, 31 Oct 2020 11:56:14 +0000 (UTC) (envelope-from gbe@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CNd1T601fz4N2m; Sat, 31 Oct 2020 11:56:13 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 874AF27414; Sat, 31 Oct 2020 11:56:13 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09VBuDA3069697; Sat, 31 Oct 2020 11:56:13 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09VBuDIH069696; Sat, 31 Oct 2020 11:56:13 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010311156.09VBuDIH069696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 31 Oct 2020 11:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367197 - stable/12/share/man/man5 X-SVN-Group: stable-12 X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: stable/12/share/man/man5 X-SVN-Commit-Revision: 367197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Oct 2020 11:56:14 -0000 Author: gbe (doc committer) Date: Sat Oct 31 11:56:13 2020 New Revision: 367197 URL: https://svnweb.freebsd.org/changeset/base/367197 Log: MFC r358891, r358894, r359454, r359513, r359550 and r359556 elf(5) Updates: - start documenting ELF note sections - Remove extra Sy from table header - table markup fixes - add definitions of FreeBSD notes - minor update to FreeBSD ELF note descriptions - correct and expand NT_FREEBSD_NOINIT_TAG description - expand on NT_FREEBSD_FEATURE_CTL bit definitions Reviewed by: emaste Approved by: emaste Modified: stable/12/share/man/man5/elf.5 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man5/elf.5 ============================================================================== --- stable/12/share/man/man5/elf.5 Sat Oct 31 11:44:10 2020 (r367196) +++ stable/12/share/man/man5/elf.5 Sat Oct 31 11:56:13 2020 (r367197) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 18, 2005 +.Dd March 11, 2020 .Dt ELF 5 .Os .Sh NAME @@ -1275,6 +1275,55 @@ member. .It Dv r_addend This member specifies a constant addend used to compute the value to be stored into the relocatable field. +.El +.Ss Note Section +ELF note sections consist of entries with the following format: +.Bl -column -offset indent "namesz" "32 bits" "Null-terminated originator name" +.Sy Field Ta Sy Size Ta Sy Description +.It Va namesz Ta 32 bits Ta Size of "name" +.It Va descsz Ta 32 bits Ta Size of "desc" +.It Va type Ta 32 bits Ta OS-dependent note type +.It Va name Ta Va namesz Ta Null-terminated originator name +.It Va desc Ta Va descsz Ta OS-dependent note data +.El +.Pp +The +.Va name +and +.Va desc +fields are padded to ensure 4-byte alignemnt. +.Va namesz +and +.Va descsz +specify the unpadded length. +.Pp +.Fx +defines the following ELF note types +.Po with corresponding interpretation of +.Va desc Pc : +.Bl -tag -width 4n +.It Dv NT_FREEBSD_ABI_TAG Pq Value: 1 +Indicates the OS ABI version in a form of a 32-bit integer containing expected +ABI version +.Po i.e., +.Dv __FreeBSD_version Pc . +.It Dv NT_FREEBSD_NOINIT_TAG Pq Value: 2 +Indicates that the C startup does not call initialization routines, and thus +.Xr rtld 1 +must do so. +.Va desc +is ignored. +.It Dv NT_FREEBSD_ARCH_TAG Pq Value: 3 +Contains the MACHINE_ARCH that the executable was built for. +.It Dv NT_FREEBSD_FEATURE_CTL Pq Value: 4 +Contains a bitmask of mitigations and features to enable: +.Bl -column "NT_FREEBSD_FCTL_PROTMAX_DISABLE" "0x00" "Disable implicit PROT_MAX" +.Sy Name Ta Sy Value Ta Sy Description +.It NT_FREEBSD_FCTL_ASLR_DISABLE Ta 0x01 Ta Disable ASLR +.It NT_FREEBSD_FCTL_PROTMAX_DISABLE Ta 0x02 Ta Disable implicit PROT_MAX +.It NT_FREEBSD_FCTL_STKGAP_DISABLE Ta 0x04 Ta Disable stack gap +.It NT_FREEBSD_FCTL_WXNEEDED Ta 0x08 Ta Binary makes W+X mappings +.El .El .Sh SEE ALSO .Xr as 1 ,