From 19a7fe52ae3d0971e67a134bcb1648899e21ae1c Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 14 Jul 2015 10:25:52 -0700 Subject: Make default compression gABI compliant All programs in binutils+gdb git repo now support gABI compression with the SHF_COMPRESSED bit. This patch makes the zlib-gabi option as compression default for gas, gold, ld and objcopy, instead of the zlib-gnu option whose outputs are incompatible with gABI. binutils/ * objcopy.c (copy_file): Set BFD_COMPRESS_GABI if not zlib-gnu. * doc/binutils.texi: Change --compress-debug-sections and --compress-debug-sections=zlib to zlib-gabi. binutils/testsuite/ * binutils-all/compress.exp: Update. gas/ * as.c (parse_args): Make --compress-debug-sections and --compress-debug-sections=zlib the same as --compress-debug-sections=zlib-gabi. * doc/as.texinfo: Change --compress-debug-sections and --compress-debug-sections=zlib to zlib-gabi. gold/ * compressed_output.cc (Output_compressed_section::set_final_data_size): Make --compress-debug-sections=zlib the same as --compress-debug-sections=zlib-gabi. * testsuite/Makefile.am (flagstest_compress_debug_sections.check): Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of ".zdebug_". * testsuite/Makefile.in: Regenerated. ld/ * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Make --compress-debug-sections=zlib the same as --compress-debug-sections=zlib-gabi. * ld.texinfo: Change --compress-debug-sections=zlib to zlib-gabi. ld/testsuite/ * ld-elf/zlibbegin.rS: Updated to .debug_.* with the SHF_COMPRESSED bit. * ld-elf/zlibnormal.rS: Likewise. --- gold/compressed_output.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'gold/compressed_output.cc') diff --git a/gold/compressed_output.cc b/gold/compressed_output.cc index 2630330..77679fe 100644 --- a/gold/compressed_output.cc +++ b/gold/compressed_output.cc @@ -233,11 +233,10 @@ Output_compressed_section::set_final_data_size() enum { none, gnu_zlib, gabi_zlib } compress; int compression_header_size = 12; const int size = parameters->target().get_size(); - if (strcmp(this->options_->compress_debug_sections(), "zlib") == 0) + if (strcmp(this->options_->compress_debug_sections(), "zlib-gnu") == 0) compress = gnu_zlib; - else if (strcmp(this->options_->compress_debug_sections(), "zlib-gnu") == 0) - compress = gnu_zlib; - else if (strcmp(this->options_->compress_debug_sections(), "zlib-gabi") == 0) + else if (strcmp(this->options_->compress_debug_sections(), "zlib-gabi") == 0 + || strcmp(this->options_->compress_debug_sections(), "zlib") == 0) { compress = gabi_zlib; if (size == 32) -- cgit v1.1