[CRIU] [PATCH 1/8] piegen: Implement tool building, v2

Cyrill Gorcunov gorcunov at gmail.com
Tue May 19 04:28:41 PDT 2015


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?


More information about the CRIU mailing list