Why does vdso appear during the execution of static binaries?

Here's an example of a quick program. (This will basically get the procmap associated with the process)

> cat sample.c

#include<stdio.h>

int main() 
{
    char buffer[1000];
    sprintf(buffer, "cat /proc/%d/maps\n", getpid());
    int status = system(buffer);
    return 1;
}

      

Preparing for static

> gcc -static -o sample sample.c 
> file sample
sample: ELF 64-bit LSB  executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.24, BuildID[sha1]=9bb9f33e867df8f2d56ffb4bfb5d348c544b1050, not stripped

      

Binary execution

> ./sample
00400000-004c0000 r-xp 00000000 08:01 12337398                           /home/admin/sample
006bf000-006c2000 rw-p 000bf000 08:01 12337398                           /home/admin/sample
006c2000-006c5000 rw-p 00000000 00:00 0 
0107c000-0109f000 rw-p 00000000 00:00 0                                  [heap]
7ffdb3d78000-7ffdb3d99000 rw-p 00000000 00:00 0                          [stack]
7ffdb3de7000-7ffdb3de9000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

      

I googled about vDSO but didn't get it right. Wikipedia says that "these are the ways in which kernel routines can be accessed from user space." My question is, why do these shared objects show up when executing static binaries?

+3


source to share


1 answer


My question is, why do these shared objects show up when executing static binaries?

They appear because your kernel "injects" them into every process.



Read more about them here and here .

+1


source







All Articles