usage of the libdep plugin of LD

Ulf Samuelsson binutils@emagii.com
Mon Feb 13 17:13:29 GMT 2023


Den 2023-02-13 kl. 17:55, skrev Marco Frigerio via Binutils:
> Hi,
> Is there a way of making sure that the libdep plugin of LD is used?

I think you need to supply an option to the LD command --plugin libdep 
or something similar.

|-plugin |name
    Involve a plugin in the linking process. The name parameter is the
    absolute filename of the plugin.
    Usually this parameter is automatically added by the complier, when
    using link time optimization,
    but users can also add their own plugins if they so wish.

    Note that the location of the compiler originated plugins is
    different from the place where the ar, nm and ranlib programs search
    for their plugins.
    In order for those commands to make use of a compiler based plugin
    it must first be copied into the ${libdir}/bfd-plugins directory.
    All gcc based linker plugins are backward compatible, so it is
    sufficient to just copy in the newest one.


Best Regards
Ulf Samuelsson


>
> I have a static .a library with the __.LIBDEP section, but linking it to an executable raises linking errors.
>
> All the errors go away if I specify manually the same '-lXXX' which is written in __.LIBDEP, suggesting that the latter is ignored.
>
> GNU Binutils v 2.38, gcc 11.3.0, on Ubuntu Linux.
>
> I could not find anything in the man pages, and the LD docs (section 4) do not say anything about enabling/loading plugins.
>
> I hope this is the right place for this kind of questions, my apologies otherwise.
> Thanks
>   - MF


More information about the Binutils mailing list