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: Cary Coutant <ccoutant at gmail dot com>
- Cc: Evgenii Stepanov <eugeni dot stepanov at gmail dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>, Binutils <binutils at sourceware dot org>
- Date: Thu, 3 Mar 2016 14:49:13 -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> <CAG3jReLJpvLnVnr-LLt=d+i34_-9ogt7HoBo=agEimYc7TcpbA at mail dot gmail dot com> <CAJimCsFcSBUuV9ncF9RQ02E_cv_-4=fjmFA1sSDxN2ZT6s_Ytw at mail dot gmail dot com> <CAG3jRe+DwrBQ5EKKqAVK-G2EuPjgMb7OVrqY-tr_d2-vBkd+_g at mail dot gmail dot com> <CABMLtrg8XsqrTs--_1kfiiy8s2L+4=+HP9vpCzgUgS=3TaPF1g at mail dot gmail dot com> <CAG3jReKWqH852qAgGL5CPxzp6WfJD-oDciO=TWd9t7Nn-qPoHA at mail dot gmail dot com> <CAJimCsGuB=0LmmL_kn5RDYUiNDhMkGyLYeGFEUNSkPrMEmdGkQ at mail dot gmail dot com>
An updated patch with changelog is attached.
Cheers,
Rafael
On 3 March 2016 at 14:19, Cary Coutant <ccoutant@gmail.com> wrote:
>> The bug is in gold. It is handling every symbol provided by the plugin
>> as defined when handling --start-lib/--end-lib members.
>>
>> Something like the attached patch should fix it.
>
> + if (sym.def != LDPK_DEF && sym.def != LDPK_WEAKDEF &&
> + sym.def != LDPK_COMMON)
> + continue;
>
> When breaking expressions, the operator should be placed at the
> beginning of the next line. Also, it would read better to have each
> condition on its own line if the line must be broken.
>
> I have a slight preference for inverting the condition:
>
> if (sym.def == LDPK_UNDEF || sym.def == LDPK_WEAKUNDEF)
> continue;
>
> There are fewer conditions to check, and if we ever add another LDPK_
> value, I think it's more likely that it'd be a kind of DEF than a kind
> of UNDEF. It also more closely mirrors the code in
> Sized_relobj_file::do_should_include_member().
>
> This is OK with that change. Thanks!
>
> -cary
Attachment:
t.diff
Description: Text document