How to take advantage of the VDSO object with your own programming language?

前端 未结 2 773
旧巷少年郎
旧巷少年郎 2021-02-06 06:15

Recent Linux kernels (at least on amd64) provide a magic object file called linux-vdso.so.1 that abstracts away the syscall interface to the kernel, allowing the ke

2条回答
  •  名媛妹妹
    2021-02-06 06:48

    I found these files in the Linux kernel tree helpful:

    • Documentation/ABI/stable/vdso (what is the vDSO object?)
    • Documentation/vDSO/parse_vdso.c (Reference parser for the vDSO object)

    The vDSO object is a virtual dynamic shared object that is always mapped into the address space of an amd64 process under linux. It can be used to implement quick system calls. To access the functions inside the vDSO object, you need to

    • locate the object
    • extract an address from the symbol table

    Both things can be done with the CC0 licensed reference implementation parse_vdso.c.

提交回复
热议问题