[PATCH] ld: Call plugin hooks only if they are available

Howard Chu hyc@symas.com
Wed Dec 16 19:06:48 GMT 2020


H.J. Lu wrote:
> On Wed, Dec 16, 2020 at 10:34 AM Howard Chu <hyc@symas.com> wrote:
>>
>> H.J. Lu wrote:
>>> On Wed, Dec 16, 2020 at 3:16 AM Nick Clifton via Binutils
>>> <binutils@sourceware.org> wrote:
>>>>
>>>> Hi Howard,
>>>>
>>>>>> Why not just make the new plugin disable itself if the host tool
>>>>>> doesn't provide the all_symbols_read entry point?
>>>>>
>>>>> Yeah, that'd be fine too. Just noop/silently exit if entry points are missing.
>>>>> I can write that up if folks agree it's better.
>>>>
>>>> Please do.
>>>>

>> The plugin shouldn't register any hooks at all, if any of these aren't available.
>> There's no point in doing the register_claim_file, that will just be wasted work.
> 
> My branch has a testcase which fails today:
> 
> https://gitlab.com/x86-binutils/binutils-gdb/-/commits/users/hjl/pr27081/master
> 
> Please send me a patch on top of mine to fix the testcase.
> 
Our emails crossed in flight; this is the same patch I just sent, but
based off your branch.

I don't know which testcases failed for you. "make check" for me fails
large numbers of cases.

-- 
  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-No-op-if-not-all-required-plugin-hooks-are-available.patch
Type: text/x-patch
Size: 1234 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20201216/aabb01aa/attachment.bin>


More information about the Binutils mailing list