[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <97990f04-9c4c-17ad-901c-5285901d5a7f@redhat.com>
Date: Wed, 24 Apr 2019 15:31:21 -0400
From: Joe Lawrence <joe.lawrence@...hat.com>
To: Joao Moreira <jmoreira@...e.de>, Miroslav Benes <mbenes@...e.cz>
Cc: linux-kernel@...r.kernel.org, live-patching@...r.kernel.org,
linux-kbuild@...r.kernel.org, Jessica Yu <jeyu@...nel.org>,
Jiri Kosina <jikos@...nel.org>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Konstantin Khlebnikov <khlebnikov@...dex-team.ru>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Michael Matz <matz@...e.de>, Nicolai Stange <nstange@...e.de>,
Petr Mladek <pmladek@...e.com>
Subject: Re: [PATCH v3 0/9] klp-convert livepatch build tooling
On 4/24/19 3:13 PM, Joao Moreira wrote:
>>> Future Work
>>> -----------
>>>
>>> I don't see an easy way to support multiple homonym <object, name>
>>> symbols with unique <position> values in the current livepatch module
>>> Elf format. The only solutions that come to mind right now include
>>> renaming homonym symbols somehow to retain the relocation->symbol
>>> relationship when separate object files are combined. Perhaps an
>>> intermediate linker step could make annotated symbols unique in some way
>>> to achieve this. /thinking out loud
>> I'd set this aside for now and we can return to it later. I think it could
>> be quite rare in practice.
I agree, especially since we can detect this corner case and abort the
translation.
>> I was thinking about renaming the symbol too. We can extend the symbol
>> naming convention we have now and deal with it in klp_resolve_symbols(),
>> but maybe Josh will come up with something clever and cleaner.
> I think this could work well, but (sorry if I understood Joe's idea
> wrongly) not as a linker step. Instead of modifying the linker, I think
> we could create another tool and plug it into the kbuild pipeline prior
> to the livepatch module linking. This way, we would parse the .o elf
> files, check for homonyms and rename them based on a convention that is
> later understood by klp-convert, as suggested.
My knowledge of the build tools is limited, so there was a bunch of
hand-waving you couldn't see when I wrote that paragraph :) But yes,
that is basically the idea: plugging into the kbuild pipeline to give
these some kinda of .o-unique prefix that klp-convert would interpret
and strip accordingly.
> If I am not missing something, this would fix the case where we have
> homonyms pointing to the same or different positions, without additional
> user intervention other then adding the SYMPOS annotations.
>
> If you consider this to be useful I can start experiencing.
>
It's not the highest priority, but even a prototype of how to insert a
script into the pipeline to achieve this would be massively time saving
for myself. If renaming looks easy, we could try to work into the
initial klp-convert patchset... if not, save it for a follow up enhancement.
Thanks,
-- Joe
Powered by blists - more mailing lists