Add ELFCOMPRESS_ZSTD ELF compression constant

ELFCOMPRESS_ZSTD indicates that an ELF section is compressed with zstd.
It is the second compression type, after the existing ELFCOMPRESS_ZLIB.
Zstd generally provides a compelling tradeoff of speed and compression
(other algorithms may compress slightly better but take a lot longer,
or run faster but do not compress nearly as well).

See https://groups.google.com/g/generic-abi/c/satyPkuMisk for details.
ELFCOMPRESS_ZSTD will be supported in a future Clang/LLVM update.  ELF
Tool Chain tools also need updating.

Reviewed by:	Fangrui Song
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Ed Maste 2022-06-28 09:06:12 -04:00
parent 865a58d2fc
commit 05b6744c44
2 changed files with 6 additions and 1 deletions

View File

@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd November 27, 2021
.Dd July 25, 2022
.Dt ELF 5
.Os
.Sh NAME
@ -1103,6 +1103,10 @@ A value of
.Dv ELFCOMPRESS_ZLIB
indicates that the data is compressed using
.Xr zlib 3 .
A value of
.Dv ELFCOMPRESS_ZSTD
indicates that the data is compressed using
Zstandard.
.It Dv ch_size
The size, in bytes, of the uncompressed section data.
This corresponds to the

View File

@ -944,6 +944,7 @@ typedef struct {
/* Values for ch_type (compressed section headers). */
#define ELFCOMPRESS_ZLIB 1 /* ZLIB/DEFLATE */
#define ELFCOMPRESS_ZSTD 2 /* Zstandard */
#define ELFCOMPRESS_LOOS 0x60000000 /* OS-specific */
#define ELFCOMPRESS_HIOS 0x6fffffff
#define ELFCOMPRESS_LOPROC 0x70000000 /* Processor-specific */