diff options
author | Andy Lutomirski <luto@mit.edu> | 2011-07-13 09:24:16 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2011-07-14 20:57:09 -0400 |
commit | 98eedc3a9dbf90cecb91093d2a7fa083942b7d13 (patch) | |
tree | 0ed9320faed2d62caea337b978d5216a7fea55a8 /Documentation/ABI | |
parent | 574c44fa8fa6262ffd5939789ef51a6e98ed62d7 (diff) |
Document the vDSO and add a reference parser
It turns out that parsing the vDSO is nontrivial if you don't already
have an ELF dynamic loader around. So document it in Documentation/ABI
and add a reference CC0-licenced parser.
This code is dedicated to Go issue 1933:
http://code.google.com/p/go/issues/detail?id=1933
Signed-off-by: Andy Lutomirski <luto@mit.edu>
Link: http://lkml.kernel.org/r/a315a9514cd71bcf29436cc31e35aada21a5ff21.1310563276.git.luto@mit.edu
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'Documentation/ABI')
-rw-r--r-- | Documentation/ABI/stable/vdso | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Documentation/ABI/stable/vdso b/Documentation/ABI/stable/vdso new file mode 100644 index 000000000000..8a1cbb594497 --- /dev/null +++ b/Documentation/ABI/stable/vdso | |||
@@ -0,0 +1,27 @@ | |||
1 | On some architectures, when the kernel loads any userspace program it | ||
2 | maps an ELF DSO into that program's address space. This DSO is called | ||
3 | the vDSO and it often contains useful and highly-optimized alternatives | ||
4 | to real syscalls. | ||
5 | |||
6 | These functions are called just like ordinary C function according to | ||
7 | your platform's ABI. Call them from a sensible context. (For example, | ||
8 | if you set CS on x86 to something strange, the vDSO functions are | ||
9 | within their rights to crash.) In addition, if you pass a bad | ||
10 | pointer to a vDSO function, you might get SIGSEGV instead of -EFAULT. | ||
11 | |||
12 | To find the DSO, parse the auxiliary vector passed to the program's | ||
13 | entry point. The AT_SYSINFO_EHDR entry will point to the vDSO. | ||
14 | |||
15 | The vDSO uses symbol versioning; whenever you request a symbol from the | ||
16 | vDSO, specify the version you are expecting. | ||
17 | |||
18 | Programs that dynamically link to glibc will use the vDSO automatically. | ||
19 | Otherwise, you can use the reference parser in Documentation/vDSO/parse_vdso.c. | ||
20 | |||
21 | Unless otherwise noted, the set of symbols with any given version and the | ||
22 | ABI of those symbols is considered stable. It may vary across architectures, | ||
23 | though. | ||
24 | |||
25 | (As of this writing, this ABI documentation as been confirmed for x86_64. | ||
26 | The maintainers of the other vDSO-using architectures should confirm | ||
27 | that it is correct for their architecture.) \ No newline at end of file | ||