diff options
author | Martin Liska <mliska@suse.cz> | 2022-10-03 09:11:00 +0200 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2022-10-11 14:13:26 +0200 |
commit | 857bddbe737bc963bd9e5a3b24743a9bba5d2d7b (patch) | |
tree | 487913f1480b0ace5fa040e07f2b839c9eb00175 /gas | |
parent | c6422d7be70f14bf7140085f2fc7a592737f5df5 (diff) | |
download | binutils-857bddbe737bc963bd9e5a3b24743a9bba5d2d7b.zip binutils-857bddbe737bc963bd9e5a3b24743a9bba5d2d7b.tar.gz binutils-857bddbe737bc963bd9e5a3b24743a9bba5d2d7b.tar.bz2 |
refactor usage of compressed_debug_section_type
bfd/ChangeLog:
* bfd-in.h (bfd_hash_set_default_size): Add COMPRESS_UNKNOWN
enum value.
(struct compressed_type_tuple): New.
* bfd-in2.h (bfd_hash_set_default_size): Regenerate.
(struct compressed_type_tuple): Likewise.
* libbfd.c (ARRAY_SIZE): New macro.
(bfd_get_compression_algorithm): New function.
(bfd_get_compression_algorithm_name): Likewise.
gas/ChangeLog:
* as.c: Do not special-case, use the new functions.
ld/ChangeLog:
* emultempl/elf.em: Do not special-case, use the new functions.
* lexsup.c (elf_static_list_options): Likewise.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/as.c | 34 |
1 files changed, 9 insertions, 25 deletions
@@ -250,21 +250,16 @@ 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")), fprintf (stream, _("\ - --nocompress-debug-sections\n\ - don't compress DWARF debug sections\n")); -#else - fprintf (stream, _("\ - --compress-debug-sections[={none|zlib|zlib-gnu|zlib-gabi|zstd}]\n\ - compress DWARF debug sections using zlib\n")); + Default: %s\n"), + bfd_get_compression_algorithm_name (flag_compress_debug)); + fprintf (stream, _("\ --nocompress-debug-sections\n\ - don't compress DWARF debug sections [default]\n")); -#endif + don't compress DWARF debug sections\n")); fprintf (stream, _("\ -D produce assembler debugging messages\n")); fprintf (stream, _("\ @@ -741,24 +736,13 @@ This program has absolutely no warranty.\n")); if (optarg) { #if defined OBJ_ELF || defined OBJ_MAYBE_ELF - if (strcasecmp (optarg, "none") == 0) - flag_compress_debug = COMPRESS_DEBUG_NONE; - else if (strcasecmp (optarg, "zlib") == 0) - flag_compress_debug = COMPRESS_DEBUG_GABI_ZLIB; - else if (strcasecmp (optarg, "zlib-gnu") == 0) - flag_compress_debug = COMPRESS_DEBUG_GNU_ZLIB; - else if (strcasecmp (optarg, "zlib-gabi") == 0) - flag_compress_debug = COMPRESS_DEBUG_GABI_ZLIB; - else if (strcasecmp (optarg, "zstd") == 0) - { -#ifdef HAVE_ZSTD - flag_compress_debug = COMPRESS_DEBUG_ZSTD; -#else + flag_compress_debug = bfd_get_compression_algorithm (optarg); +#ifndef HAVE_ZSTD + if (flag_compress_debug == COMPRESS_DEBUG_ZSTD) as_fatal (_ ("--compress-debug-sections=zstd: gas is not " "built with zstd support")); #endif - } - else + if (flag_compress_debug == COMPRESS_UNKNOWN) as_fatal (_("Invalid --compress-debug-sections option: `%s'"), optarg); #else |