0

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.

1 Answers1

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