aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2021-11-29 18:51:50 +0000
committerMark Johnston <markj@FreeBSD.org>2021-11-29 18:57:24 +0000
commite0189cf66a94e1149793caf4dea17288da22a0c3 (patch)
treeb39194ad772f29d1d0b0adf92057ad958ffd1d53
parent9ff084f0fab6846aa6f30bb1aac9692461405f86 (diff)
downloadsrc-e0189cf66a94e1149793caf4dea17288da22a0c3.tar.gz
src-e0189cf66a94e1149793caf4dea17288da22a0c3.zip
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
-rw-r--r--share/man/man5/elf.549
1 files changed, 48 insertions, 1 deletions
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