From patchwork Fri Sep 30 09:48:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 1585 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp397835wrs; Fri, 30 Sep 2022 02:49:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7bhHOfcaN6JbDlHjr9TetXFCZbyuvpqwuyw62Vdp92hOEUHl+PmUr7IJdwRLwHOFuecCxg X-Received: by 2002:a05:6402:ea8:b0:456:d188:b347 with SMTP id h40-20020a0564020ea800b00456d188b347mr7151324eda.15.1664531371433; Fri, 30 Sep 2022 02:49:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664531371; cv=none; d=google.com; s=arc-20160816; b=NXaPE1VBUPTiIVTqjDjCK9bTu7IiOjFymaUGNSKirXUnMLQSpuxB/HW4MqsR7SRoZd 6uZ8Wh7eSN1Wzwv4z7fuC+cuXRUsWGSHIRgjDNRCQ+/tIpL2lUNy2B2dTH5/tQVamvDQ 90+IuIySg1k0l6pmN98Is5sZIB84Enw35qQDMlNYc283GVkhZIYUBFKAOY64GLcQ+4lS wJQveyeOnOWGotv0s+y2VuRxPicXPAMkW6swa+fCqHFZeKvdDhfzQGE5DqgaXQjLx3NL TIe0e9BG/9MOGNchBeE2PEXM9bUlxEOFa2eN3VKQjRlRt/RrLKUFT13foSLHm6mlgueu aEtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :in-reply-to:content-language:references:to:subject:from:user-agent :mime-version:date:message-id:dkim-signature:dkim-signature :dmarc-filter:delivered-to; bh=Hk68RjC/Ma1XvKKtgJ7y52Km5uQDKM5ko795DbX/Xls=; b=gbXPTkb1K2es/7LONioQ6EK166G8a/bD2p3ULislY2kFUBB5Z92j1MEzo3SfZ33dsD KxfeBdG3VkoBIDqZyWMqd7CJYhnxKa2X5ZB2sC3TaPuD2KVBxIiLMRY9xLEd+eyoYG9o apzS8wwPhU2b2k8Q8idQjtVU+FcIeq+Qqplxz2XqmZduB1UoHPFvdNAhk5oe1kpG4raS +et3DtQ+PbAW5aiUkaibgfiROHVgEkCsP+nL3PXyXcxjjRZ77EPfEX9dqb/AV7KZk7f2 y4ouCah44W4+BdWYxn0lwypD052QzgZj/SHH6VTXydGBcopJ8vXmRebY6KkDrayyBdzs nrFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=gEag7Zz3; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id bi10-20020a170906a24a00b00782bffd5b3fsi1189288ejb.903.2022.09.30.02.49.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Sep 2022 02:49:31 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=gEag7Zz3; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 04A463858CDB for ; Fri, 30 Sep 2022 09:49:30 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id E8E5C3858D1E for ; Fri, 30 Sep 2022 09:48:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E8E5C3858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3152F1F892; Fri, 30 Sep 2022 09:48:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1664531334; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Hk68RjC/Ma1XvKKtgJ7y52Km5uQDKM5ko795DbX/Xls=; b=gEag7Zz3QGA0xSqS6SSwu7XwtBXL3pTkSomgK33XeVSuQBOKGwcxzel9Fe9Qm1o4PcQaQx c7z3lFqq1J55z6o1haZK9aCGgLBQFTCxvVuOfYMAxNDvyRx37YCWj3eUjynym6pQa6dAIe UzYVKvlef9hvD97a01JKSWmzcT3QAn0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1664531334; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Hk68RjC/Ma1XvKKtgJ7y52Km5uQDKM5ko795DbX/Xls=; b=jiefno8gOWOWaHcAcR1FycdBbDbN3DPpW6xinELsgywZynW9NDnK9Ft+LIU2TremhHOJBg PvxojmI1hexoAiCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1126013677; Fri, 30 Sep 2022 09:48:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id EWNJA4a7NmP0ZQAAMHmgww (envelope-from ); Fri, 30 Sep 2022 09:48:54 +0000 Message-ID: <61355429-24b3-17d0-ab03-6fa57ee861d5@suse.cz> Date: Fri, 30 Sep 2022 11:48:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH][RFC] add --enable-zstd-compressed-debug-sections configure option To: binutils@sourceware.org References: <20220929201711.7nz236xraosd76za@google.com> Content-Language: en-US In-Reply-To: <20220929201711.7nz236xraosd76za@google.com> X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_SOFTFAIL, 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fangrui Song Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1745387646929661398?= X-GMAIL-MSGID: =?utf-8?q?1745387646929661398?= Hello. The patch can set up default compression algorithm as zstd instead of the default zlib-gabi. The patch is lightly tested as readelf can't decompress debug sections: https://sourceware.org/bugzilla/show_bug.cgi?id=29640 Thoughts? ChangeLog: * configure.ac: Add --enable-zstd-compressed-debug-sections configure option. * configure: Regenerate. gas/ChangeLog: * NEWS: Mention --enable-zstd-compressed-debug-sections. * as.c: Respect FLAG_ZSTD_COMPRESS_DEBUG and should it in --help. * configure.ac: Add --enable-zstd-compressed-debug-sections configure option. * configure: Regenerate. * config.in: Regenerate. ld/ChangeLog: * NEWS: Mention --enable-zstd-compressed-debug-sections. * configure.ac: Add --enable-zstd-compressed-debug-sections configure option. * configure: Regenerate. * config.in: Regenerate. * ldmain.c: Respenct FLAG_ZSTD_COMPRESS_DEBUG. * lexsup.c: Likewise. --- configure | 17 +++++++++++++++++ configure.ac | 6 ++++++ gas/NEWS | 3 +++ gas/as.c | 24 ++++++++++++++++-------- gas/config.in | 3 +++ gas/configure | 20 ++++++++++++++++++-- gas/configure.ac | 10 ++++++++++ ld/NEWS | 3 +++ ld/config.in | 3 +++ ld/configure | 20 ++++++++++++++++++-- ld/configure.ac | 10 ++++++++++ ld/ldmain.c | 4 ++++ ld/lexsup.c | 5 +++++ 13 files changed, 116 insertions(+), 12 deletions(-) diff --git a/configure b/configure index f14e0efd675..03c26c455c7 100755 --- a/configure +++ b/configure @@ -792,6 +792,7 @@ enable_gold enable_ld enable_gprofng enable_compressed_debug_sections +enable_zstd_compressed_debug_sections enable_year2038 enable_libquadmath enable_libquadmath_support @@ -1523,6 +1524,9 @@ Optional Features: --enable-compressed-debug-sections={all,gas,gold,ld,none} Enable compressed debug sections for gas, gold or ld by default + --enable-zstd-compressed-debug-sections + Use zstd for debug info sections compression by + default. --enable-year2038 enable support for timestamps past the year 2038 --disable-libquadmath do not build libquadmath directory --disable-libquadmath-support @@ -3119,6 +3123,19 @@ else fi + +# Check whether --enable-zstd_compressed_debug_sections was given. +if test "${enable_zstd_compressed_debug_sections+set}" = set; then : + enableval=$enable_zstd_compressed_debug_sections; + if test x"$enable_compressed_debug_sections" = xyes; then + as_fn_error $? "no program with compressed debug sections specified" "$LINENO" 5 + fi + +else + zstd_compressed_debug_sections= +fi + + # Configure extra directories which are host specific case "${host}" in diff --git a/configure.ac b/configure.ac index 0152c69292e..1728991ab8a 100644 --- a/configure.ac +++ b/configure.ac @@ -422,6 +422,12 @@ AC_ARG_ENABLE(compressed_debug_sections, fi ], [enable_compressed_debug_sections=]) + +AC_ARG_ENABLE(zstd_compressed_debug_sections, +[AS_HELP_STRING([--enable-zstd-compressed-debug-sections], + [Use zstd for debug info sections compression by default.])], +[], [zstd_compressed_debug_sections=]) + # Configure extra directories which are host specific case "${host}" in diff --git a/gas/NEWS b/gas/NEWS index 9a8b726b942..8f509f3aebf 100644 --- a/gas/NEWS +++ b/gas/NEWS @@ -2,6 +2,9 @@ * gas now supports --compress-debug-sections=zstd to compress debug sections with zstd. +* Add a configure option --enable-zstd-compressed-debug-sections + in order to use zstd as a default compression algorithm when + --compress-debug-sections is used (or enabled by default). Changes in 2.39: diff --git a/gas/as.c b/gas/as.c index 9ce3d622f95..8c9c1d7abfd 100644 --- a/gas/as.c +++ b/gas/as.c @@ -226,8 +226,12 @@ print_version_id (void) #ifdef DEFAULT_FLAG_COMPRESS_DEBUG enum compressed_debug_section_type flag_compress_debug +#if FLAG_ZSTD_COMPRESS_DEBUG + = COMPRESS_DEBUG_ZSTD; +#else = COMPRESS_DEBUG_GABI_ZLIB; #endif +#endif static void show_usage (FILE * stream) @@ -250,21 +254,25 @@ Options:\n\ fprintf (stream, _("\ --alternate initially turn on alternate macro syntax\n")); -#ifdef DEFAULT_FLAG_COMPRESS_DEBUG fprintf (stream, _("\ --compress-debug-sections[={none|zlib|zlib-gnu|zlib-gabi|zstd}]\n\ - compress DWARF debug sections using zlib [default]\n")); + compress DWARF debug sections\n")); +#ifdef DEFAULT_FLAG_COMPRESS_DEBUG +#if FLAG_ZSTD_COMPRESS_DEBUG fprintf (stream, _("\ - --nocompress-debug-sections\n\ - don't compress DWARF debug sections\n")); + Default: zstd\n")); #else fprintf (stream, _("\ - --compress-debug-sections[={none|zlib|zlib-gnu|zlib-gabi|zstd}]\n\ - compress DWARF debug sections using zlib\n")); + Default: zlib-gabi\n")); +#endif +#else fprintf (stream, _("\ - --nocompress-debug-sections\n\ - don't compress DWARF debug sections [default]\n")); + Default: none\n")); #endif + + fprintf (stream, _("\ + --nocompress-debug-sections\n\ + don't compress DWARF debug sections\n")); fprintf (stream, _("\ -D produce assembler debugging messages\n")); fprintf (stream, _("\ diff --git a/gas/config.in b/gas/config.in index 0d1668a3eac..35b8c0cc26a 100644 --- a/gas/config.in +++ b/gas/config.in @@ -71,6 +71,9 @@ language is requested. */ #undef ENABLE_NLS +/* Define to 1 if you want compressed debug sections with zstd by default. */ +#undef FLAG_ZSTD_COMPRESS_DEBUG + /* Define to 1 if you have the declaration of `asprintf', and to 0 if you don't. */ #undef HAVE_DECL_ASPRINTF diff --git a/gas/configure b/gas/configure index 02cded59b6a..10a095f89c7 100755 --- a/gas/configure +++ b/gas/configure @@ -810,6 +810,7 @@ enable_largefile enable_targets enable_checking enable_compressed_debug_sections +enable_zstd_compressed_debug_sections enable_x86_relax_relocations enable_elf_stt_common enable_generate_build_notes @@ -1476,6 +1477,9 @@ Optional Features: --enable-checking enable run-time checks --enable-compressed-debug-sections={all,gas,none} compress debug sections by default + --enable-zstd-compressed-debug-sections + Use zstd for debug info sections compression by + default --enable-x86-relax-relocations generate x86 relax relocations by default --enable-elf-stt-common generate ELF common symbols with STT_COMMON type by @@ -10722,7 +10726,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10725 "configure" +#line 10729 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10828,7 +10832,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10831 "configure" +#line 10835 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11502,6 +11506,12 @@ if test "${enable_compressed_debug_sections+set}" = set; then : esac fi +# Use zstd compression algorithm by default. +# Check whether --enable-zstd_compressed_debug_sections was given. +if test "${enable_zstd_compressed_debug_sections+set}" = set; then : + enableval=$enable_zstd_compressed_debug_sections; ac_zstd_compressed_debug_sections=$enableval +fi + # PR gas/19520 # Decide if x86 assembler should generate relax relocations. ac_default_x86_relax_relocations=unset @@ -12671,6 +12681,12 @@ $as_echo "#define DEFAULT_FLAG_COMPRESS_DEBUG 1" >>confdefs.h fi +if test x$ac_zstd_compressed_debug_sections = xyes ; then + +$as_echo "#define FLAG_ZSTD_COMPRESS_DEBUG 1" >>confdefs.h + +fi + # Turn on all targets if possible if test ${all_targets} = "yes"; then case ${target_cpu_type} in diff --git a/gas/configure.ac b/gas/configure.ac index e6f3298cb3e..b46acfe9033 100644 --- a/gas/configure.ac +++ b/gas/configure.ac @@ -76,6 +76,12 @@ AC_ARG_ENABLE(compressed_debug_sections, *) ac_default_compressed_debug_sections=unset ;; esac])dnl +# Use zstd compression algorithm by default. +AC_ARG_ENABLE(zstd_compressed_debug_sections, + AS_HELP_STRING([--enable-zstd-compressed-debug-sections], + [Use zstd for debug info sections compression by default]), +[ac_zstd_compressed_debug_sections=$enableval])dnl + # PR gas/19520 # Decide if x86 assembler should generate relax relocations. ac_default_x86_relax_relocations=unset @@ -755,6 +761,10 @@ if test x$ac_default_compressed_debug_sections = xyes ; then AC_DEFINE(DEFAULT_FLAG_COMPRESS_DEBUG, 1, [Define if you want compressed debug sections by default.]) fi +if test x$ac_zstd_compressed_debug_sections = xyes ; then + AC_DEFINE(FLAG_ZSTD_COMPRESS_DEBUG, 1, [Define to 1 if you want compressed debug sections with zstd by default.]) +fi + # Turn on all targets if possible if test ${all_targets} = "yes"; then case ${target_cpu_type} in diff --git a/ld/NEWS b/ld/NEWS index dfe2690d9f2..82619b3625e 100644 --- a/ld/NEWS +++ b/ld/NEWS @@ -2,6 +2,9 @@ * ld now supports zstd compressed debug sections. The new option --compress-debug-sections=zstd compresses debug sections with zstd. +* Add a configure option --enable-zstd-compressed-debug-sections + in order to use zstd as a default compression algorithm when + --compress-debug-sections is used (or enabled by default). Changes in 2.39: diff --git a/ld/config.in b/ld/config.in index 3916740eee4..93ec9cee232 100644 --- a/ld/config.in +++ b/ld/config.in @@ -58,6 +58,9 @@ /* Additional extension a shared object might have. */ #undef EXTRA_SHLIB_EXTENSION +/* Define to 1 if you want compressed debug sections with zstd by default. */ +#undef FLAG_ZSTD_COMPRESS_DEBUG + /* Define to choose default GOT handling scheme */ #undef GOT_HANDLING_DEFAULT diff --git a/ld/configure b/ld/configure index 9dd3ed5f1e7..fa21b5de04e 100755 --- a/ld/configure +++ b/ld/configure @@ -841,6 +841,7 @@ with_sysroot enable_gold enable_got enable_compressed_debug_sections +enable_zstd_compressed_debug_sections enable_new_dtags enable_relro enable_textrel_check @@ -1524,6 +1525,9 @@ Optional Features: multigot) --enable-compressed-debug-sections={all,ld,none} compress debug sections by default] + --enable-zstd-compressed-debug-sections + Use zstd for debug info sections compression by + default --enable-new-dtags set DT_RUNPATH instead of DT_RPATH by default] --enable-relro enable -z relro in ELF linker by default --enable-textrel-check=[yes|no|warning|error] @@ -11620,7 +11624,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11623 "configure" +#line 11627 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11726,7 +11730,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11729 "configure" +#line 11733 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15544,6 +15548,12 @@ if test "${enable_compressed_debug_sections+set}" = set; then : esac fi +# Use zstd compression algorithm by default. +# Check whether --enable-zstd_compressed_debug_sections was given. +if test "${enable_zstd_compressed_debug_sections+set}" = set; then : + enableval=$enable_zstd_compressed_debug_sections; ac_zstd_compressed_debug_sections=$enableval +fi + # Decide setting DT_RUNPATH instead of DT_RPATH by default ac_default_new_dtags=unset # Provide a configure time option to override our default. @@ -17340,6 +17350,12 @@ $as_echo "#define DEFAULT_FLAG_COMPRESS_DEBUG 1" >>confdefs.h fi +if test x$ac_zstd_compressed_debug_sections = xyes ; then + +$as_echo "#define FLAG_ZSTD_COMPRESS_DEBUG 1" >>confdefs.h + +fi + if test "${ac_default_new_dtags}" = unset; then ac_default_new_dtags=0 fi diff --git a/ld/configure.ac b/ld/configure.ac index f1b2f9897f8..729f07343aa 100644 --- a/ld/configure.ac +++ b/ld/configure.ac @@ -163,6 +163,12 @@ AC_ARG_ENABLE(compressed_debug_sections, ,no, | ,none,) ac_default_compressed_debug_sections=no ;; esac])dnl +# Use zstd compression algorithm by default. +AC_ARG_ENABLE(zstd_compressed_debug_sections, + AS_HELP_STRING([--enable-zstd-compressed-debug-sections], + [Use zstd for debug info sections compression by default]), +[ac_zstd_compressed_debug_sections=$enableval])dnl + # Decide setting DT_RUNPATH instead of DT_RPATH by default ac_default_new_dtags=unset # Provide a configure time option to override our default. @@ -510,6 +516,10 @@ if test x$ac_default_compressed_debug_sections = xyes ; then AC_DEFINE(DEFAULT_FLAG_COMPRESS_DEBUG, 1, [Define if you want compressed debug sections by default.]) fi +if test x$ac_zstd_compressed_debug_sections = xyes ; then + AC_DEFINE(FLAG_ZSTD_COMPRESS_DEBUG, 1, [Define to 1 if you want compressed debug sections with zstd by default.]) +fi + if test "${ac_default_new_dtags}" = unset; then ac_default_new_dtags=0 fi diff --git a/ld/ldmain.c b/ld/ldmain.c index d63002c994a..d0ad5f3d797 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -352,8 +352,12 @@ main (int argc, char **argv) link_info.spare_dynamic_tags = 5; link_info.path_separator = ':'; #ifdef DEFAULT_FLAG_COMPRESS_DEBUG +#if FLAG_ZSTD_COMPRESS_DEBUG + link_info.compress_debug = COMPRESS_DEBUG_ZSTD; +#else link_info.compress_debug = COMPRESS_DEBUG_GABI_ZLIB; #endif +#endif #ifdef DEFAULT_NEW_DTAGS link_info.new_dtags = DEFAULT_NEW_DTAGS; #endif diff --git a/ld/lexsup.c b/ld/lexsup.c index 299371fb775..c46f1f822a8 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -2149,8 +2149,13 @@ elf_static_list_options (FILE *file) --compress-debug-sections=[none|zlib|zlib-gnu|zlib-gabi|zstd]\n\ Compress DWARF debug sections\n")); #ifdef DEFAULT_FLAG_COMPRESS_DEBUG +#if FLAG_ZSTD_COMPRESS_DEBUG + fprintf (file, _("\ + Default: zstd\n")); +#else fprintf (file, _("\ Default: zlib-gabi\n")); +#endif #else fprintf (file, _("\ Default: none\n"));