public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* use copy_private_symbol_data in objcopy
@ 2024-04-23 11:41 Alan Modra
  2024-04-23 13:58 ` H.J. Lu
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Modra @ 2024-04-23 11:41 UTC (permalink / raw)
  To: binutils

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++)
+    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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: use copy_private_symbol_data in objcopy
  2024-04-23 11:41 use copy_private_symbol_data in objcopy Alan Modra
@ 2024-04-23 13:58 ` H.J. Lu
  0 siblings, 0 replies; 2+ messages in thread
From: H.J. Lu @ 2024-04-23 13:58 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-23 13:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-23 11:41 use copy_private_symbol_data in objcopy Alan Modra
2024-04-23 13:58 ` H.J. Lu

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).