diff options
author | Alan Modra <amodra@gmail.com> | 2022-12-07 09:28:18 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-12-07 13:15:29 +1030 |
commit | c3620d6d5639ab7a0b483030350e8f2929212ea7 (patch) | |
tree | 802bc807b5e2feb2f5f55ab54c8479cdd7c14529 /ld/emultempl | |
parent | 9db0f1ae844614673957e48257aba137e3c41133 (diff) | |
download | gdb-c3620d6d5639ab7a0b483030350e8f2929212ea7.zip gdb-c3620d6d5639ab7a0b483030350e8f2929212ea7.tar.gz gdb-c3620d6d5639ab7a0b483030350e8f2929212ea7.tar.bz2 |
Compression tidy and fixes
Tidies:
- Move stuff from bfd-in.h and libbfd.c to compress.c
- Delete COMPRESS_DEBUG from enum compressed_debug_section_type
- Move compress_debug field out of link_info to ld_config.
Fixes:
- Correct test in bfd_convert_section_setup to use obfd flags,
not ibfd.
- Apply bfd_applicable_file_flags to compression bfd flags added
by gas and ld to the output bfd.
bfd/
* bfd-in.h (enum compressed_debug_section_type),
(struct compressed_type_tuple),
(bfd_get_compression_algorithm),
(bfd_get_compression_algorithm_name),
* libbfd.c (compressed_debug_section_names),
(bfd_get_compression_algorithm),
(bfd_get_compression_algorithm_name): Move..
* compress.c: ..to here, deleting COMPRESS_DEBUG from
enum compressed_debug_section_type.
(bfd_convert_section_setup): Test obfd flags not ibfd for
compression flags.
* elf.c (elf_fake_sections): Replace link_info->compress_debug
test with abfd->flags test.
* bfd-in2.h: Regenerate.
binutils/
* objcopy.c (copy_file): Tidy setting of bfd compress flags.
Expand comment.
gas/
* write.c (compress_debug): Test bfd compress flags rather than
flag_compress_debug.
(write_object_file): Apply bfd_applicable_file_flags to compress
debug flags added to output bfd.
include/
* bfdlink.h (struct bfd_link_info): Delete compress_debug.
ld/
* ld.h (ld_config_type): Add compress_debug.
* emultempl/elf.em: Replace references to link_info.compress_debug
with config.compress_debug.
* lexsup.c (elf_static_list_options): Likewise.
* ldmain.c (main): Likewise. Apply bfd_applicable_file_flags
to compress debug flags added to output bfd.
Diffstat (limited to 'ld/emultempl')
-rw-r--r-- | ld/emultempl/elf.em | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ld/emultempl/elf.em b/ld/emultempl/elf.em index 5dfc03a..5e96335 100644 --- a/ld/emultempl/elf.em +++ b/ld/emultempl/elf.em @@ -660,16 +660,16 @@ gld${EMULATION_NAME}_handle_option (int optc) break; case OPTION_COMPRESS_DEBUG: - link_info.compress_debug = bfd_get_compression_algorithm (optarg); + config.compress_debug = bfd_get_compression_algorithm (optarg); if (strcasecmp (optarg, "zstd") == 0) { #ifndef HAVE_ZSTD - if (link_info.compress_debug == COMPRESS_DEBUG_ZSTD) + if (config.compress_debug == COMPRESS_DEBUG_ZSTD) einfo (_ ("%F%P: --compress-debug-sections=zstd: ld is not built " "with zstd support\n")); #endif } - if (link_info.compress_debug == COMPRESS_UNKNOWN) + if (config.compress_debug == COMPRESS_UNKNOWN) einfo (_("%F%P: invalid --compress-debug-sections option: \`%s'\n"), optarg); break; |