From nobody Mon Dec 06 14:04:55 2021 X-Original-To: dev-commits-src-all@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 886DE1893053; Mon, 6 Dec 2021 14:04:56 +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 4J74tw1y1vz3lwx; Mon, 6 Dec 2021 14:04:56 +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 1829E5126; Mon, 6 Dec 2021 14:04:56 +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 1B6E4uoq081747; Mon, 6 Dec 2021 14:04:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B6E4tFx081746; Mon, 6 Dec 2021 14:04:55 GMT (envelope-from git) Date: Mon, 6 Dec 2021 14:04:55 GMT Message-Id: <202112061404.1B6E4tFx081746@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 3f9a6f6cf317 - stable/13 - elf.5: Document compressed section headers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3f9a6f6cf3179a4ea3652779f40d640b0dc6083a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638799496; 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=TFcrbYpn+dOzf6EFSQWDEfb1H2KMDPHHRTwmtsJADIc=; b=fQJQeQJx+NcrHpAyRIW2GCIYwsMc8VPzItyR5fB/Ms+H3XVHANRvKFnYQEOuZ2Y8HLGgF3 /WVk3QVVem7FUTZT67eZ+tNLEtTGFMypF7hUtVvU7kKVroWVmmtrFGt3C3hL07Vxq/wAtp qph2jbMAucMp2vCEcAJlZZy+tH3G3pymg/QrkZuUCLVSzKlNgYv50Szl9HKAQCRrf1UauH 1vFPARrDFRbXDVF1ytkBKLMswgcBmcHGAKqnOdTR6UU0Sgi0tK2kq2VAGT+yckfNBuoMnM zzJYKnah9l9QVJ6ctjK+FnFhWSTp2MinNhj/24CyKm25ZHiLPGKuFoAjBTcsww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638799496; a=rsa-sha256; cv=none; b=e6i1yg9AFznH8PvNcNJ8crm/gJzfaAtTpsWy9fe/SgxiYqkbHb6lZpnX9ujkG4YdvoXvqm sb6GKiFpbaZO2BUutZ4lYzdX6D6WLRwkhTvFkg1TLzPLc/0rLkrN0c9m19veYwtiuIeqLg MpHXH6WD+3Zb+HZcTb6HbrqlXBdZ8O/P9eREC0XCdvzgxxKj0trFwAyBmrGxE6SN1WteSa xLbEUid52Nju9lXQJsB6/YR6AxRBhYiZFECTc8mVxvaqIvhuHoQ36m56jAbNif9bDDne0t fZZLhGaFFdLFom5uq0M3r8Le7CyXOr79ebDKZTZOme+I9TDKHvJRWNS6o+gmVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3f9a6f6cf3179a4ea3652779f40d640b0dc6083a commit 3f9a6f6cf3179a4ea3652779f40d640b0dc6083a Author: Mark Johnston AuthorDate: 2021-11-29 18:51:50 +0000 Commit: Mark Johnston CommitDate: 2021-12-06 14:03:50 +0000 elf.5: Document compressed section headers Reviewed by: emaste Sponsored by: The FreeBSD Foundation (cherry picked from commit e0189cf66a94e1149793caf4dea17288da22a0c3) --- 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