[CRIU] [PATCH] pie: relocs -- Fix compilation on ARM

Cyrill Gorcunov gorcunov at gmail.com
Tue Jun 9 13:55:32 PDT 2015


On Tue, Jun 09, 2015 at 11:49:38PM +0300, Pavel Emelyanov wrote:
> On 06/09/2015 11:47 PM, Cyrill Gorcunov wrote:
> > On Tue, Jun 09, 2015 at 11:26:06PM +0300, Pavel Emelyanov wrote:
> >>
> >> This routine is called two times with last two arguments being the same -- elf_relocs
> >> and sizeof(elf_relocs). Why can't we stop treating them as arguments and just reference
> >> in the elf_relocs_apply as (global) variables?
> > 
> > They are generated dynamically and not present on the systems which use old scheme
> > (arm and such), so I don't see a reason why to make code more messy and define them
> > somewhere as a global for those who don't even touch them.
> 
> Look at parasite_infect_siezed(). It calls elf_relocs_apply() and passes
> elf_relocs and ARRAY_SIZE(of it) as two last arguments and this elf_relocs
> is NOT local variable to parasite_infect_siezed(), it's global. Why not
> just reference one directly in parasite_infect_siezed()?

Where to get it from? Do you propose to _allocate_ elf_relocs on the machines
which do not use this function at all? What the point? Currently, when arm
uses old scheme the preprocessor defines all things to nop, if we define
some empty elf_relocs it won't be nop anymore, but eat some tiny byte of
memory, so I fail to see what the benefit in defining global @elf_relocs.
Or you mean to use @elf_relocs inside elf_relocs_apply itself cutting off
them from the argumenst?


More information about the CRIU mailing list