On 03/05/11 14:07, Wan Mohd Fairuz Wan Ismail wrote: > The situation: > The function load_ELF (elf.c) will try to load the executable and the > interpreter to the memory. For android's /system/bin/linker, the > calculated interp_size value is 2952865436. > > The formula end = (iph->p_vaddr - interp_addr) + iph->p_memsz; gives > us 0xb001269c = (0xb0009000 - 0x0) + 0x969c so that's why we have > interp_size as big as 2.9GB. So I tried to do interp_size = end & > 0xFFFFF.. There is no more UME 22 Error but I got a Segmentation fault > (the program works fine alone).
Basically valgrind is trying to cheat, and instead of mapping each LOAD segment in the ELF file separately it is trying to map one block of contiguous memory and then load each segment at the correct offset in that block. Unfortunately it seems that the Android interpreter is linked in such a way that the load segments are a long way apart, so it winds up trying to allocate a very large block of memory, most of which won't be used. If you can run readelf then try "readelf -l /system/bin/linker" and let us see the output - you may have to copy the linker off onto a conventional system and run readelf there. Tom -- Tom Hughes ([email protected]) http://compton.nu/ ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd _______________________________________________ Valgrind-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/valgrind-users
