summaryrefslogtreecommitdiff
path: root/libdwfl/zstd.c
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2020-09-18 12:49:29 +0200
committerMark Wielaard <mark@klomp.org>2020-09-21 15:17:00 +0200
commit52536d7d213846a3122d4dd40f6268f231109990 (patch)
tree22b4947a69be0e27a58c0d8fa62e60d9511482a2 /libdwfl/zstd.c
parent04bcab70c7dcb9c1bc7ca49508b5d7cbd5aeaa1a (diff)
downloadelfutils-52536d7d213846a3122d4dd40f6268f231109990.tar.gz
libdwfl: Add ZSTD support.
Newer kernels might be compressed using ZSTD add support to libdwfl open so we can can automatically read ZSTD compressed files and kernel images. The support is very similar to the bzip2 and lzma support, but slightly different. With a bit more macros it could maybe have used the gzip.c USE_INFLATE code path. But I felt that the many macros didn't really help understand the code. So the unzip routine has a slightly different code path for ZSTD. https://sourceware.org/bugzilla/show_bug.cgi?id=26632 Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'libdwfl/zstd.c')
-rw-r--r--libdwfl/zstd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libdwfl/zstd.c b/libdwfl/zstd.c
new file mode 100644
index 00000000..dc4d5238
--- /dev/null
+++ b/libdwfl/zstd.c
@@ -0,0 +1,4 @@
+/* libzstd is pretty close to zlib and bzlib. */
+
+#define ZSTD
+#include "gzip.c"