git: 05b6744c446c - main - Add ELFCOMPRESS_ZSTD ELF compression constant

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Mon, 25 Jul 2022 14:02:14 UTC
The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=05b6744c446c2d274738fbb27a3ded1bf9f9f1d1

commit 05b6744c446c2d274738fbb27a3ded1bf9f9f1d1
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2022-06-28 13:06:12 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2022-07-25 14:01:54 +0000

    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
---
 share/man/man5/elf.5 | 6 +++++-
 sys/sys/elf_common.h | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/share/man/man5/elf.5 b/share/man/man5/elf.5
index 81376e7e6bb9..95bc183a1f91 100644
--- a/share/man/man5/elf.5
+++ b/share/man/man5/elf.5
@@ -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
diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h
index 4eae060895ab..23440f535887 100644
--- a/sys/sys/elf_common.h
+++ b/sys/sys/elf_common.h
@@ -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 */