[PATCH v2] bfd/ELF: fix BFD library build --enable-shared
Matthieu Longo
matthieu.longo@arm.com
Mon Jan 26 11:09:57 GMT 2026
On 26/01/2026 10:27, Jan Beulich wrote:
> On 26.01.2026 11:03, Matthieu Longo wrote:
>> On 26/01/2026 08:24, Jan Beulich wrote:
>>> On 23.01.2026 17:19, Matthieu Longo wrote:
>>>> The patch series that added support for Object Attributes v2 introduced
>>>> regressions when building the BFD library as a shared object.
>>>>
>>>> Incorrect usages of ATTRIBUTE_HIDDEN caused the following link-time errors:
>>>>
>>>> /usr/bin/ld: config/obj-elf-attr.o: in function `obj_attr_v2_record':
>>>> obj-elf-attr.c: undefined reference to `bfd_elf_obj_attr_v2_init'
>>>> obj-elf-attr.c: undefined reference to `_bfd_obj_attr_v2_find_by_tag'
>>>> obj-elf-attr.c: undefined reference to `obj_attr_v2_t_append'
>>>> /usr/bin/ld: config/obj-elf-attr.o: in function `obj_attr_v2_subsection_record':
>>>> obj-elf-attr.c: undefined reference to `obj_attr_subsection_v2_t_append'
>>>> obj-elf-attr.c: undefined reference to `obj_attr_subsection_v2_t_remove'
>>>> obj-elf-attr.c: undefined reference to `obj_attr_subsection_v2_t_append'
>>>>
>>>> This patch fixes the symbols visibility so that the BFD library links
>>>> correctly when built with --enable-shared.
>>>> The ATTRIBUTE_HIDDEN annotations were removed from bfd_elf_obj_attr_v2_init
>>>> and _bfd_obj_attr_v2_find_by_tag, and the functions were renamed to reflect
>>>> the belonging to the public BFD API using the 'bfd_' prefix.
>>>
>>> Nit: Only one of the functions was actually renamed.
>>
>> Fixed and merged.
>
> Of course this one now also needs to go on the 2.46 branch.
>
> Jan
Applied on the 2.46 branch a few minutes ago.
Matthieu
More information about the Binutils
mailing list