Does execv() family of functions call mmap() functions internally to load text,data,bss segments from elf file? Can any one please share the blocks or steps involved in the working of exec() functions. Also please suggest some links or books to learn about how exec works internally.
Asked
Active
Viewed 273 times
0
-
No idea. I would look at the source code as my next step. – Oliver Charlesworth Aug 29 '16 at 14:49
-
http://linux.die.net/man/3/execv – Hackerman Aug 29 '16 at 14:49
-
1you can use strace on a program using execv to see all system calls – DrPrItay Aug 29 '16 at 18:23
-
4Possible duplicate of [Please explain the exec() function and its family](https://stackoverflow.com/q/4204915/608639) – jww May 05 '19 at 05:18
1 Answers
4
The execv() is a userspace libc wrapper which pass control through syscall to kernel side into do_execve() .
do_execve() finds appropriate binary handler for exec file to load. We will next consider example for ELF executable format.
The appropriate binary handler for elf format is load_elf_binary() . It uses elf_map() to map appropriate elf segments to memory through vm_mmap() API.
Is that what are you asking about?

Alex Hoppus
- 3,821
- 4
- 28
- 47
-
Yes, this is what I want, I can use this information to get a detailed overview. Thanks Alex – charanchakravarhy Aug 29 '16 at 15:50