Where Is Linux-Vdso. So.1 Present on the File System

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

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

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest