]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libelf: Document and make ELFCOMPRESS_ZSTD usable with old system elf.h
authorMark Wielaard <mark@klomp.org>
Fri, 3 Mar 2023 14:37:18 +0000 (15:37 +0100)
committerMark Wielaard <mark@klomp.org>
Fri, 3 Mar 2023 14:39:53 +0000 (15:39 +0100)
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>
ChangeLog
NEWS
libelf/ChangeLog
libelf/libelf.h

index 53a1d29279b10a6b6ec54289b07d749908374429..10c23002279ecd39aca36926d44b6cba58eacb9d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2023-03-03  Mark Wielaard  <mark@klomp.org>
+
+       * NEWS: Add ELFCOMPRESS_ZSTD support for libelf and elfcompress.
+
 2023-02-23  Mark Wielaard  <mark@klomp.org>
 
        * NEWS: Add old version code names.
diff --git a/NEWS b/NEWS
index c01513d0174fa2ff04733a0591a3a9e26f23566c..4985658fa8694aeed25cad71614c86a621e66661 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,11 +1,17 @@
-Version 0.189
+Version 0.189 "Don't deflate!"
 
 configure: eu-nm, eu-addr2line and eu-stack can provide demangled symbols
            when linked with libstdc++. Use --disable-demangler to disable.
 
+libelf: elf_compress now supports ELFCOMPRESS_ZSTD when build against
+        libzstd
+
 libdwfl: dwfl_module_return_value_location now returns 0 (no return type)
          for DIEs that point to a DW_TAG_unspecified_type.
 
+elfcompress: -t, --type= now support zstd if libelf has been build with
+             ELFCOMPRESS_ZSTD support.
+
 Version 0.188 "no section left behind"
 
 readelf: Add -D, --use-dynamic option.
index bfd6b82d4fdb49f76d5b5fc3997a07d4011b2a2e..8cc3c53c250f063cc9ab94fecba4225ba5b2816a 100644 (file)
@@ -1,3 +1,8 @@
+2023-03-03  Mark Wielaard  <mark@klomp.org>
+
+       * libelf.h: Define ELFCOMPRESS_ZSTD if undefined.
+       (elf_compress): Document ELFCOMPRESS_ZSTD compression type.
+
 2023-02-20  Mark Wielaard  <mark@klomp.org>
 
        * gnuhash_xlate.h (elf_cvt_gnuhash): memmove any left over bytes.
index a139e733ae7e97d158433b8d81f32901663772d5..2374a48a00f4a849baf3f95817ede956bfcbb9d0 100644 (file)
  #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