1 What: vDSO 1 What: vDSO 2 Date: July 2011 2 Date: July 2011 3 KernelVersion: 3.0 3 KernelVersion: 3.0 4 Contact: Andy Lutomirski <luto@kernel.or 4 Contact: Andy Lutomirski <luto@kernel.org> 5 Description: 5 Description: 6 6 7 On some architectures, when the kernel loads a 7 On some architectures, when the kernel loads any userspace program it 8 maps an ELF DSO into that program's address sp 8 maps an ELF DSO into that program's address space. This DSO is called 9 the vDSO and it often contains useful and high 9 the vDSO and it often contains useful and highly-optimized alternatives 10 to real syscalls. 10 to real syscalls. 11 11 12 These functions are called according to your p 12 These functions are called according to your platform's ABI. On many 13 platforms they are called just like ordinary C 13 platforms they are called just like ordinary C function. On other platforms 14 (ex: powerpc) they are called with the same co 14 (ex: powerpc) they are called with the same convention as system calls which 15 is different from ordinary C functions. Call t 15 is different from ordinary C functions. Call them from a sensible context. 16 (For example, if you set CS on x86 to somethin 16 (For example, if you set CS on x86 to something strange, the vDSO functions are 17 within their rights to crash.) In addition, i 17 within their rights to crash.) In addition, if you pass a bad 18 pointer to a vDSO function, you might get SIGS 18 pointer to a vDSO function, you might get SIGSEGV instead of -EFAULT. 19 19 20 To find the DSO, parse the auxiliary vector pa 20 To find the DSO, parse the auxiliary vector passed to the program's 21 entry point. The AT_SYSINFO_EHDR entry will p 21 entry point. The AT_SYSINFO_EHDR entry will point to the vDSO. 22 22 23 The vDSO uses symbol versioning; whenever you 23 The vDSO uses symbol versioning; whenever you request a symbol from the 24 vDSO, specify the version you are expecting. 24 vDSO, specify the version you are expecting. 25 25 26 Programs that dynamically link to glibc will u 26 Programs that dynamically link to glibc will use the vDSO automatically. 27 Otherwise, you can use the reference parser in 27 Otherwise, you can use the reference parser in 28 tools/testing/selftests/vDSO/parse_vdso.c. 28 tools/testing/selftests/vDSO/parse_vdso.c. 29 29 30 Unless otherwise noted, the set of symbols wit 30 Unless otherwise noted, the set of symbols with any given version and the 31 ABI of those symbols is considered stable. It 31 ABI of those symbols is considered stable. It may vary across architectures, 32 though. 32 though. 33 33 34 Note: 34 Note: 35 As of this writing, this ABI documentation as 35 As of this writing, this ABI documentation as been confirmed for x86_64. 36 The maintainers of the other vDSO-using archi 36 The maintainers of the other vDSO-using architectures should confirm 37 that it is correct for their architecture. 37 that it is correct for their architecture.
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.