[PATCH v9 10/19] bfd: add support for copying Object Attributes v2
Matthieu Longo
matthieu.longo@arm.com
Wed Nov 5 15:14:22 GMT 2025
On 31/10/2025 10:43, Jan Beulich wrote:
> 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
I made the function static from this patch, not from when it was
introduced. Otherwise it triggers a compilation error as it is unused.
Matthieu
More information about the Binutils
mailing list