Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

Where is linux-vdso.so.1 present on the file system

Writer Mia Lopez

I am learning about VDSO, wrote a simple application which calls gettimeofday()

#define _GNU_SOURCE
#include <sys/syscall.h>
#include <sys/time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int main(int argc, char *argv[])
{ struct timeval current_time; if (gettimeofday(&current_time, NULL) == -1) printf("gettimeofday"); getchar(); exit(EXIT_SUCCESS);
}

ldd on the binary shows 'linux-vdso'

$ ldd ./prog linux-vdso.so.1 (0x00007ffce147a000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6ef9e8e000) /lib64/ld-linux-x86-64.so.2 (0x00007f6efa481000)

I did a find for the libvdso library and there is no such library present in my file system.

sudo find / -name 'linux-vdso.so*'

Where is the library present?

1

2 Answers

It's a virtual shared object that doesn't have any physical file on the disk; it's a part of the kernel that's exported into every program's address space when it's loaded.

It's main purpose to make more efficient to call certain system calls (which would otherwise incur performance issues like this). The most prominent being gettimeofday(2).

You can read more about it here:

1
find / -name '*vdso*.so*' 

yields

/lib/modules/4.15.0-108-generic/vdso/vdso64.so
/lib/modules/4.15.0-108-generic/vdso/vdso32.so
/lib/modules/4.15.0-108-generic/vdso/vdsox32.so

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy