From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 816683858CDB for ; Fri, 3 Mar 2023 14:42:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 816683858CDB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from r6.localdomain (82-217-174-174.cable.dynamic.v4.ziggo.nl [82.217.174.174]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 570A030067B8; Fri, 3 Mar 2023 15:42:05 +0100 (CET) Received: by r6.localdomain (Postfix, from userid 1000) id 68C1034025F; Fri, 3 Mar 2023 15:42:04 +0100 (CET) From: Mark Wielaard To: elfutils-devel@sourceware.org Cc: Mark Wielaard Subject: [COMMITTED] libelf: Document and make ELFCOMPRESS_ZSTD usable with old system elf.h Date: Fri, 3 Mar 2023 15:42:02 +0100 Message-Id: <20230303144202.329710-1-mark@klomp.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3035.8 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 --- ChangeLog | 4 ++++ NEWS | 8 +++++++- libelf/ChangeLog | 5 +++++ libelf/libelf.h | 13 +++++++++---- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 53a1d292..10c23002 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2023-03-03 Mark Wielaard + + * NEWS: Add ELFCOMPRESS_ZSTD support for libelf and elfcompress. + 2023-02-23 Mark Wielaard * NEWS: Add old version code names. diff --git a/NEWS b/NEWS index c01513d0..4985658f 100644 --- 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. diff --git a/libelf/ChangeLog b/libelf/ChangeLog index bfd6b82d..8cc3c53c 100644 --- a/libelf/ChangeLog +++ b/libelf/ChangeLog @@ -1,3 +1,8 @@ +2023-03-03 Mark Wielaard + + * libelf.h: Define ELFCOMPRESS_ZSTD if undefined. + (elf_compress): Document ELFCOMPRESS_ZSTD compression type. + 2023-02-20 Mark Wielaard * gnuhash_xlate.h (elf_cvt_gnuhash): memmove any left over bytes. 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 -- 2.39.2