From nobody Mon Nov 29 18:57:56 2021 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 A66B318AE178; Mon, 29 Nov 2021 18:57:59 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2vkG3r08z3Fc4; Mon, 29 Nov 2021 18:57:58 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 0FE8827C27; Mon, 29 Nov 2021 18:57:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATIvulP020466; Mon, 29 Nov 2021 18:57:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATIvu4f020465; Mon, 29 Nov 2021 18:57:56 GMT (envelope-from git) Date: Mon, 29 Nov 2021 18:57:56 GMT Message-Id: <202111291857.1ATIvu4f020465@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: e0189cf66a94 - main - elf.5: Document compressed section headers 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e0189cf66a94e1149793caf4dea17288da22a0c3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638212279; 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=NNzVrSBgob6doIheE+GA0eu6JVbmT74eW2Wf7R9FZHA=; b=qrQxSshyOxawUgU9zfXeNJKjzevWStybyrIS3vcJ1VrCaO/Wk+hvlwcfjEGEHnbWkhUgw6 B53WZknneeXkfyxyy82E2LorxlKotQjeAiH8rLNThXkjzPfpGRAF5VTFAURvoKEGW/G8z4 Xhb8tBEaDzmmauuLC2JIhHHs0RkWs8wNb18GUxG+gzyU6lsTY8RuYNrb1B+Vh/e/UpyeVa J+h4cCO5pFT5E/CCqeTGpVrHtKWM0TE66XbL+lapUMU3uu7KjNZHCbQYHDc4faPPYPTXQQ VIXNpuDfdL101cQConhjPfJwl4+jStC3EB1t7KX/x9oLGOHca06yWo1X8ktOwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638212279; a=rsa-sha256; cv=none; b=oarcs6mGwG41iBnHB+PAtzJ+LWThFUwnIBM6NLpRd/dtxvnA+W+g4yrDR1UYJUXF4x54z+ OGovqGzAbEdu1Ej1s2Qgg1gK4/DdcjcyVyE2jbTSEEHB1mowTdDuRyHXinlL0vYWRwAZVY hQ4kbx70G8LyOnixbNqguwoY8dcV/Rfwg9/UGwkC7WsDGxRdgoLn9ufQznW0aWWe6imutE K65hunUYB017vLSPRH++PMmQARhtE3vSLjd292eo21NKY0/h8FAvBanhpMr38Q+HPLptm/ AB0nujZ/bbsoN3WCY8rLUrlLkMwr3AKFAY6uoJ+WSG1GDCscowxPn56VAQKdoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e0189cf66a94e1149793caf4dea17288da22a0c3 commit e0189cf66a94e1149793caf4dea17288da22a0c3 Author: Mark Johnston AuthorDate: 2021-11-29 18:51:50 +0000 Commit: Mark Johnston CommitDate: 2021-11-29 18:57:24 +0000 elf.5: Document compressed section headers Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33138 --- share/man/man5/elf.5 | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/share/man/man5/elf.5 b/share/man/man5/elf.5 index 3134e8614988..81376e7e6bb9 100644 --- a/share/man/man5/elf.5 +++ b/share/man/man5/elf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2020 +.Dd November 27, 2021 .Dt ELF 5 .Os .Sh NAME @@ -795,6 +795,8 @@ The section contains executable machine instructions. .It Dv SHF_MASKPROC All bits included in this mask are reserved for processor-specific semantics. +.It Dv SHF_COMPRESSED +The section data is compressed. .El .Pp .It Dv sh_addr @@ -1069,6 +1071,50 @@ be registered. This section holds information used for C++ exception-handling. .El .Pp +A section with the +.Dv SHF_COMPRESSED +flag set contains a compressed copy of the section data. +Compressed section data begins with an +.Vt Elf64_Chdr +or +.Vt Elf32_Chdr structure +which encodes the compression algorithm and some characteristics of the +uncompressed data. +.Bd -literal -offset indent +typedef struct { + Elf32_Word ch_type; + Elf32_Word ch_size; + Elf32_Word ch_addralign; +} Elf32_Chdr; +.Ed +.Bd -literal -offset indent +typedef struct { + Elf64_Word ch_type; + Elf64_Word ch_reserved; + Elf64_Xword ch_size; + Elf64_Xword ch_addralign; +} Elf64_Chdr; +.Ed +.Pp +.Bl -tag -width "ch_addralign" -compact +.It Dv ch_type +The compression algorithm used. +A value of +.Dv ELFCOMPRESS_ZLIB +indicates that the data is compressed using +.Xr zlib 3 . +.It Dv ch_size +The size, in bytes, of the uncompressed section data. +This corresponds to the +.Sy sh_size +field of a section header containing uncompressed data. +.It Dv ch_addralign +The address alignment of the uncompressed section data. +This corresponds to the +.Sy sh_addralign +field of a section header containing uncompressed data. +.El +.Pp String table sections hold null-terminated character sequences, commonly called strings. The object file uses these strings to represent symbol @@ -1342,6 +1388,7 @@ writeable and executable. .Xr objdump 1 , .Xr readelf 1 , .Xr execve 2 , +.Xr zlib 3 , .Xr ar 5 , .Xr core 5 .Rs