public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Fangrui Song <maskray@google.com>
To: Alan Modra <amodra@gmail.com>
Cc: Cary Coutant <ccoutant@gmail.com>, binutils@sourceware.org
Subject: Re: [PATCH] gold: add --compress-debug-sections=zstd [PR 29641]
Date: Fri, 11 Nov 2022 00:00:44 -0800	[thread overview]
Message-ID: <CAFP8O3KQjtkcpffTpYw8zhAp=HgnSu=rayjoFKsGWuKLnLWHYw@mail.gmail.com> (raw)
In-Reply-To: <Y238b4zohOjpRLkX@squeak.grove.modra.org>

On Thu, Nov 10, 2022 at 11:40 PM Alan Modra <amodra@gmail.com> wrote:
>
> Applied.
> 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,

Sorry for my embarrassing last-minute error and thanks for fixing it :)

> diff --git a/gold/compressed_output.cc b/gold/compressed_output.cc
> index e9f12241f26..f192ddb5080 100644
> --- a/gold/compressed_output.cc
> +++ b/gold/compressed_output.cc
> @@ -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);
>
> --
> Alan Modra
> Australia Development Lab, IBM



-- 
宋方睿

      reply	other threads:[~2022-11-11  8:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-01  2:38 Fangrui Song
2022-10-11  3:21 ` ping " Fangrui Song
2022-10-21  5:46   ` PING^2 " Fangrui Song
2022-11-10 21:46 ` Cary Coutant
2022-11-10 21:47   ` Cary Coutant
2022-11-10 22:00 ` Cary Coutant
2022-11-11  7:40   ` Alan Modra
2022-11-11  8:00     ` Fangrui Song [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFP8O3KQjtkcpffTpYw8zhAp=HgnSu=rayjoFKsGWuKLnLWHYw@mail.gmail.com' \
    --to=maskray@google.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=ccoutant@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).