[PATCH v9 10/19] bfd: add support for copying Object Attributes v2
Jan Beulich
jbeulich@suse.com
Fri Oct 31 10:43:27 GMT 2025
On 01.09.2025 18:56, Matthieu Longo wrote:
> @@ -805,6 +795,49 @@ _bfd_elf_copy_obj_attributes (bfd *ibfd, bfd *obfd)
> }
> }
>
> +/* Copy object attributes v2 from IBFD to OBFD. */
> +static void
> +oav2_copy_attributes (bfd *ibfd, bfd *obfd)
> +{
> + obj_attr_subsection_list *in_attr_subsecs = &elf_obj_attr_subsections (ibfd);
> + obj_attr_subsection_list *out_attr_subsecs = &elf_obj_attr_subsections (obfd);
> +
> + for (obj_attr_subsection_v2 *isubsec = in_attr_subsecs->first;
> + isubsec != NULL;
> + isubsec = isubsec->next)
> + {
> + obj_attr_subsection_v2 *osubsec
> + = _bfd_elf_obj_attr_subsection_v2_copy (isubsec);
This is, afaict, the first (and likely only) caller of this function. The
function lives in the same source file, so why would it be non-static?
Other than this the change looks okay to me once constification of pointer
targets was suitably done.
Jan
More information about the Binutils
mailing list