public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Alan Modra <amodra@gmail.com>
Cc: binutils@sourceware.org
Subject: Re: use copy_private_symbol_data in objcopy
Date: Tue, 23 Apr 2024 06:58:47 -0700	[thread overview]
Message-ID: <CAMe9rOr2Ka+pqAeJkuXRiekbjFhqQOgaHPXicPZYQofCHzmCoA@mail.gmail.com> (raw)
In-Reply-To: <ZieeeYlWq8PFbe7l@squeak.grove.modra.org>

On Tue, Apr 23, 2024 at 4:42 AM Alan Modra <amodra@gmail.com> wrote:
>
> osympp appearing twice here is not a bug.
>
>         PR 14493
>         * objcopy.c (copy_object): Run the symbols through
>         bfd_copy_private_symbol_data.
>
> diff --git a/binutils/objcopy.c b/binutils/objcopy.c
> index d91ba123c01..634ebae3fc3 100644
> --- a/binutils/objcopy.c
> +++ b/binutils/objcopy.c
> @@ -3380,6 +3380,13 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
>        symcount = filter_symbols (ibfd, obfd, osympp, isympp, symcount);
>      }
>
> +  for (i = 0; i < symcount; i++)

This failed to compile with GCC 14 on 32-bit hosts:

/export/gnu/import/git/sources/binutils-gdb/binutils/objcopy.c: In
function ‘copy_object’:
/export/gnu/import/git/sources/binutils-gdb/binutils/objcopy.c:3383:17:
error: comparison of integer expressions of different signedness:
‘unsigned int’ and ‘long int’ [-Werror=sign-compare]
 3383 |   for (i = 0; i < symcount; i++)
      |                 ^

> +    if (!bfd_copy_private_symbol_data (ibfd, osympp[i], obfd, osympp[i]))
> +      {
> +       status = 1;
> +       return false;
> +      }
> +
>    if (dhandle != NULL)
>      {
>        bool res;
>
> --
> Alan Modra
> Australia Development Lab, IBM



-- 
H.J.

      reply	other threads:[~2024-04-23 13:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23 11:41 Alan Modra
2024-04-23 13:58 ` H.J. Lu [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=CAMe9rOr2Ka+pqAeJkuXRiekbjFhqQOgaHPXicPZYQofCHzmCoA@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    /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).