This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: linker plugin api limitation
- From: Rafael EspÃndola <rafael dot espindola at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Evgenii Stepanov <eugeni dot stepanov at gmail dot com>, Binutils <binutils at sourceware dot org>, Cary Coutant <ccoutant at gmail dot com>
- Date: Mon, 22 Feb 2016 14:15:59 -0500
- 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> <CAMe9rOrrp7mxdQV+SEfpxTOMQmREg2HYY9S9H=Z4c8QX0JE6bw at mail dot gmail dot com> <CAG3jReJqFPpUZa-crehm-r2MEnw_ogMjbVVrOhe0jSruGDhXsg at mail dot gmail dot com> <CABMLtrhEQ824a-R02oO0GY+t6LHn65bokqHggCsGaY03eFMR2A at mail dot gmail dot com> <CAMe9rOoqnpXmviqZ-rfUUc0FxwGB5=Rodyc0Pq4HQ3-CQy2WDg at mail dot gmail dot com> <CAG3jReJRXr1K=i9DvUO+JH-27xa=aNObUQaq3DNshUk+r2Zyew at mail dot gmail dot com> <CAMe9rOpLaGp=3fBxKiCxmnXBqvzNszz1VThbTm3m7tG+X6rPuQ at mail dot gmail dot com>
>
> So you want to add
>
> LDPT_GET_DEFINED_SYMBOLS
>
> to enum ld_plugin_tag, which returns a list of symbols defined
> in the IR file. Am I correct?
No. The existing api works just fine for collecting the symbols defined.
What is needed is a way to let the plugin know that a file it provided
symbols for is not to be used in the link.
One way to do it is to add another return value to the function that
is passed via LDPT_GET_SYMBOLS. Since it is a new return value and
there is already a _V2, what we need is a LDPT_GET_SYMBOLS_V3 that
can return a new value.
Another way is to add a new LDPT_IS_HANDLE_USED which the plugin is
supposed to call first to check if file associated with a given handle
should be used or not.
Cheers,
Rafael