[PATCH v9 10/19] bfd: add support for copying Object Attributes v2

Jan Beulich jbeulich@suse.com
Fri Nov 7 08:44:17 GMT 2025


On 05.11.2025 16:14, Matthieu Longo wrote:
> 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.
> 
> I made the function static from this patch, not from when it was 
> introduced. Otherwise it triggers a compilation error as it is unused.

That's not very nice, but well ...

Jan


More information about the Binutils mailing list