summaryrefslogtreecommitdiff
path: root/libelf/libelf.h
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2023-03-03 15:37:18 +0100
committerMark Wielaard <mark@klomp.org>2023-03-03 15:39:53 +0100
commit0a52a7dc8b96cf7bc1733176b1660303157e0afa (patch)
tree1ad3361a063b6b267f727306d94d2fbe598a04ae /libelf/libelf.h
parentb1fa74956793141771a6514c445d0884fdef3841 (diff)
downloadelfutils-0a52a7dc8b96cf7bc1733176b1660303157e0afa.tar.gz
libelf: Document and make ELFCOMPRESS_ZSTD usable with old system elf.h
Make sure that even if the system elf.h doesn't have ELF_COMPRESS_ZSTD defined it can still be used as constant. Also update libelf.h documentation and add new feature to NEWS. Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'libelf/libelf.h')
-rw-r--r--libelf/libelf.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/libelf/libelf.h b/libelf/libelf.h
index a139e733..2374a48a 100644
--- a/libelf/libelf.h
+++ b/libelf/libelf.h
@@ -64,6 +64,11 @@
#define ELFCOMPRESS_HIPROC 0x7fffffff /* End of processor-specific. */
#endif
+#ifndef ELFCOMPRESS_ZSTD
+ /* So ZSTD compression can be used even with an old system elf.h. */
+ #define ELFCOMPRESS_ZSTD 2 /* Zstandard algorithm. */
+#endif
+
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
# define __nonnull_attribute__(...) __attribute__ ((__nonnull__ (__VA_ARGS__)))
# define __deprecated_attribute__ __attribute__ ((__deprecated__))
@@ -348,10 +353,10 @@ extern Elf64_Chdr *elf64_getchdr (Elf_Scn *__scn);
elf_compress takes a compression type that should be either zero to
decompress or an ELFCOMPRESS algorithm to use for compression.
- Currently only ELFCOMPRESS_ZLIB is supported. elf_compress_gnu
- will compress in the traditional GNU compression format when
- compress is one and decompress the section data when compress is
- zero.
+ Currently ELFCOMPRESS_ZLIB and ELFCOMPRESS_ZSTD are supported.
+ elf_compress_gnu will compress in the traditional GNU compression
+ format when compress is one and decompress the section data when
+ compress is zero.
The FLAGS argument can be zero or ELF_CHF_FORCE. If FLAGS contains
ELF_CHF_FORCE then it will always compress the section, even if