diff options
author | Mark Wielaard <mark@klomp.org> | 2023-03-03 15:37:18 +0100 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2023-03-03 15:39:53 +0100 |
commit | 0a52a7dc8b96cf7bc1733176b1660303157e0afa (patch) | |
tree | 1ad3361a063b6b267f727306d94d2fbe598a04ae /libelf/libelf.h | |
parent | b1fa74956793141771a6514c445d0884fdef3841 (diff) | |
download | elfutils-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.h | 13 |
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 |