[PATCH v2] Limit BFD_SUPPORTS_PLUGINS check to plugin.h and targets.c

H.J. Lu hjl.tools@gmail.com
Sun Aug 17 14:58:45 GMT 2025


On Sun, Aug 17, 2025 at 6:00 AM Alan Modra <amodra@gmail.com> wrote:
>
> On Sat, Aug 16, 2025 at 03:05:49PM -0700, H.J. Lu wrote:
> > Minimize the BFD_SUPPORTS_PLUGINS check to make code more readable and
> > maintainable by:
> >
> > 1. Update bfd_check_format_matches to require the plugin target for slim
> > LTO IR object if it isn't a linker input.
>
> I already said I didn't like this part.  You haven't given me any
> reason to change my mind.

Only linker doesn't use the BFD plugin target on slim IR objects.  Everyone
else should use the BFD plugin target on slim IR objects.  There is no need for
ar, nm, objcopy to use the BFD plugin target explicitly.

> > 2. Update bfd/plugin.h to define plugin functions as static inline if
> > BFD_SUPPORTS_PLUGINS is 0.
> > 3. Remove BFD_SUPPORTS_PLUGINS check from all bfd and binutils files
> > except plugin.h and targets.c.
> > 4. Replace the remaining BFD_SUPPORTS_PLUGINS checks with a function so
> > that plugin availability is checked at run time.
>
> --
> Alan Modra



-- 
H.J.


More information about the Binutils mailing list