This is the mail archive of the
mailing list for the binutils project.
Re: linker plugin api limitation
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Rafael EspÃndola <rafael dot espindola at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>, Cary Coutant <ccoutant at gmail dot com>, Evgenii Stepanov <eugeni dot stepanov at gmail dot com>
- Date: Mon, 22 Feb 2016 09:14:28 -0800
- Subject: Re: linker plugin api limitation
- Authentication-results: sourceware.org; auth=none
- References: <CAG3jReJDT2ZDNRh-cYSSBG76FnrReQWbgFgfsA_gvLdb5zmEEw at mail dot gmail dot com> <CAMe9rOqQnyagQ=4BdfkNgPiAzc9X4B0=BNibChyhJfd3osCcmw at mail dot gmail dot com> <CAG3jRe+BBQ-oSU9gu8h26jWZYh1ET03cAunVxsFyUomyC8XJZA at mail dot gmail dot com> <CAMe9rOoRMbnbn+WQ2OYfFDOjqedOQb7z0kcPLpGOAn8RZd01cQ at mail dot gmail dot com> <CAG3jReL4_b=1QUVbtbFsD3A=MmXUB0ia=0NAmA+Vfs_8R4PBrA at mail dot gmail dot com>
On Mon, Feb 22, 2016 at 8:40 AM, Rafael EspÃndola
>>> I don't think it is implemented in BFD ld. The idea is that using
>>> $ ld ... --start-lib <objs> --end-lib
>>> should be equivalent to
>>> $ ar rc foo.a <objs>
>>> $ ld ... foo.a
>>> ar is normally very fast, but when doing a fully distributed build one
>>> would still need to copy <objs> to a node just to create foo.a. Using
>>> --start-lib/--end-lib saves that step.
>> Have you tried the AR equivalent with gold?
> I did not, but I am pretty sure what happens: The plugin is never even
> asked to look at the member since gold only needs the archive index to
> know the member is not used.
> The difference with --start-lib/--end-lib is that gold has to use the
> plugin to find out the symbols defined by a file to know if it is
> needed in the link or not.
The plugin API does support it as shown by
ar rc foo.a <objs>
gold ... foo.a
Gold just fails to handle it properly.