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

Pavel Emelyanov xemul at parallels.com
Tue Jun 9 13:49:38 PDT 2015


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()?


More information about the CRIU mailing list