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

Alan Modra amodra@gmail.com
Sun Aug 17 13:00:48 GMT 2025


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.

> 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


More information about the Binutils mailing list