public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: Mark Harmstone <mark@harmstone.com>, binutils@sourceware.org
Subject: Re: [PATCH] ld: Add module information substream to PDB files
Date: Wed, 2 Nov 2022 14:12:28 +0000	[thread overview]
Message-ID: <d33ba65b-a1ce-1854-ecb8-0fa6f3743bb4@redhat.com> (raw)
In-Reply-To: <20221102020752.24441-1-mark@harmstone.com>

Hi Mark,

> +  *data = xmalloc (*size);
> +
> +  ptr = *data;
> +
> +  for (bfd *in = coff_data (abfd)->link_info->input_bfds; in;
> +       in = in->link.next)
> +    {
> +      struct module_info *mod = (struct module_info *) ptr;
> +      uint16_t stream_num;
> +      bfd *stream;
> +      uint32_t sym_byte_size;
> +      uint8_t *start = ptr;
> +
> +      stream = add_stream (pdb, NULL, &stream_num);
> +
> +      if (!stream)
> +	{
> +	  free (data);
> +	  return false;
> +	}

This fails to compile with:

    inlined from 'create_pdb_file' at /work/sources/binutils/upstream/current/ld/pdb.c:1097:8:
/work/sources/binutils/upstream/current/ld/pdb.c:481:11: error: 'free' called on unallocated object 'mod_info' [-Werror=free-nonheap-object]
   481 |           free (data);
       |           ^~~~~~~~~~~
/work/sources/binutils/upstream/current/ld/pdb.c: In function 'create_pdb_file':
/work/sources/binutils/upstream/current/ld/pdb.c:604:9: note: declared here
   604 |   void *mod_info;

Possibly you meant "free (*data)" ?

Cheers
   Nick


  reply	other threads:[~2022-11-02 14:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02  2:07 Mark Harmstone
2022-11-02 14:12 ` Nick Clifton [this message]
2022-11-03  2:45   ` Mark Harmstone

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=d33ba65b-a1ce-1854-ecb8-0fa6f3743bb4@redhat.com \
    --to=nickc@redhat.com \
    --cc=binutils@sourceware.org \
    --cc=mark@harmstone.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).