Re: Enable --build-id for moxie-elf-ld
[deliverable/binutils-gdb.git] / gold / compressed_output.cc
index 263033097426ea7ab8cfe3a9cc9488816ca5b40b..a8db3b6f04b5d3dfac6f07fde29167d203fde49e 100644 (file)
@@ -1,6 +1,6 @@
 // compressed_output.cc -- manage compressed debug sections for gold
 
-// Copyright (C) 2007-2015 Free Software Foundation, Inc.
+// Copyright (C) 2007-2019 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -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)
@@ -287,6 +286,8 @@ Output_compressed_section::set_final_data_size()
                  chdr.put_ch_type(elfcpp::ELFCOMPRESS_ZLIB);
                  chdr.put_ch_size(uncompressed_size);
                  chdr.put_ch_addralign(addralign);
+                 // Clear the reserved field.
+                 chdr.put_ch_reserved(0);
                }
              else
                {
@@ -294,6 +295,8 @@ Output_compressed_section::set_final_data_size()
                  chdr.put_ch_type(elfcpp::ELFCOMPRESS_ZLIB);
                  chdr.put_ch_size(uncompressed_size);
                  chdr.put_ch_addralign(addralign);
+                 // Clear the reserved field.
+                 chdr.put_ch_reserved(0);
                }
            }
          else
This page took 0.025912 seconds and 4 git commands to generate.