aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-10-03 09:11:00 +0200
committerMartin Liska <mliska@suse.cz>2022-10-11 14:13:26 +0200
commit857bddbe737bc963bd9e5a3b24743a9bba5d2d7b (patch)
tree487913f1480b0ace5fa040e07f2b839c9eb00175 /ld/emultempl
parentc6422d7be70f14bf7140085f2fc7a592737f5df5 (diff)
downloadbinutils-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 'ld/emultempl')
-rw-r--r--ld/emultempl/elf.em22
1 files changed, 7 insertions, 15 deletions
diff --git a/ld/emultempl/elf.em b/ld/emultempl/elf.em
index acd66f9..5dfc03a 100644
--- a/ld/emultempl/elf.em
+++ b/ld/emultempl/elf.em
@@ -660,24 +660,16 @@ gld${EMULATION_NAME}_handle_option (int optc)
break;
case OPTION_COMPRESS_DEBUG:
- if (strcasecmp (optarg, "none") == 0)
- link_info.compress_debug = COMPRESS_DEBUG_NONE;
- else if (strcasecmp (optarg, "zlib") == 0)
- link_info.compress_debug = COMPRESS_DEBUG_GABI_ZLIB;
- else if (strcasecmp (optarg, "zlib-gnu") == 0)
- link_info.compress_debug = COMPRESS_DEBUG_GNU_ZLIB;
- else if (strcasecmp (optarg, "zlib-gabi") == 0)
- link_info.compress_debug = COMPRESS_DEBUG_GABI_ZLIB;
- else if (strcasecmp (optarg, "zstd") == 0)
+ link_info.compress_debug = bfd_get_compression_algorithm (optarg);
+ if (strcasecmp (optarg, "zstd") == 0)
{
-#ifdef HAVE_ZSTD
- link_info.compress_debug = COMPRESS_DEBUG_ZSTD;
-#else
- einfo (_ ("%F%P: --compress-debug-sections=zstd: ld is not built "
- "with zstd support\n"));
+#ifndef HAVE_ZSTD
+ if (link_info.compress_debug == COMPRESS_DEBUG_ZSTD)
+ einfo (_ ("%F%P: --compress-debug-sections=zstd: ld is not built "
+ "with zstd support\n"));
#endif
}
- else
+ if (link_info.compress_debug == COMPRESS_UNKNOWN)
einfo (_("%F%P: invalid --compress-debug-sections option: \`%s'\n"),
optarg);
break;