Re: gold: add --compress-debug-sections=zstd [PR 29641]
authorAlan Modra <amodra@gmail.com>
Fri, 11 Nov 2022 07:31:58 +0000 (18:01 +1030)
committerAlan Modra <amodra@gmail.com>
Fri, 11 Nov 2022 07:35:36 +0000 (18:05 +1030)
Fix the following:
compressed_output.cc:86:8: error: assignment of read-only variable ‘size’
   86 |   size = ZSTD_compress(*compressed_data + header_size, size, uncompressed_data,

gold/compressed_output.cc

index e9f12241f26c199ae4e003ebb2c40f90bb047409..f192ddb508006e115b4bfe286d470787eb6d2c11 100644 (file)
@@ -81,7 +81,7 @@ zstd_compress(int header_size, const unsigned char *uncompressed_data,
              unsigned long uncompressed_size,
              unsigned char **compressed_data, unsigned long *compressed_size)
 {
-  const size_t size = ZSTD_compressBound(uncompressed_size);
+  size_t size = ZSTD_compressBound(uncompressed_size);
   *compressed_data = new unsigned char[size + header_size];
   size = ZSTD_compress(*compressed_data + header_size, size, uncompressed_data,
                       uncompressed_size, ZSTD_CLEVEL_DEFAULT);