[CRIU] [PATCH 1/8] piegen: Implement tool building, v2
Laurent Dufour
ldufour at linux.vnet.ibm.com
Tue May 19 04:36:00 PDT 2015
On 19/05/2015 13:28, Cyrill Gorcunov wrote:
> On Tue, May 19, 2015 at 01:18:23PM +0200, Laurent Dufour wrote:
>>
>> Hi Cyrill,
>>
>> Here you are copying all the blob's file to get loaded at runtime. But,
>> only ELF sections flagged "PROGBITS" should be copied in memory at
>> runtime, and so in the output stream (there is no need to load
>> relocation sections, symbol tables, etc).
>>
>> There is a major side effect: the offset of the loaded section is
>> changed due to interleaved section ignored. So this should be handle
>> earlier, to have correct section's offset.
>
> That's why we load the complete object into the memory, instead of
> parsing which sections to load and which to ignore. Look, this is
> not the real Elf loader as say in-kernel one but quite simplified
> one which only purpose is to resolve relocs and be able to run
> parasite code. Moreover it must do this operation very fast.
> That said sure we can drop off the sections we don't need but
> this will cause offsets shift as you mentioned. So I think an
> easiest way is to load complete object. Am I missing something?
>
My point is that we may remove the unneeded section at build time, and
compute the offset of the remaining section accordingly. This will have
impact on the offset compute at build time but all the work will be done
at build time.
This should not change the relocation effort done at loading time which
should remain the same (just the value are different).
This being said, I may have something myself ;), isn't it ?
More information about the CRIU
mailing list