Commit Graph
10 Commits
Author SHA1 Message Date
Rich Felker 58e75db471 add working vdso clock_gettime support, including static linking
the vdso symbol lookup code is based on the original 2011 patch by
Nicholas J. Kain, with some streamlining, pointer arithmetic fixes,
and one symbol version matching fix.

on the consumer side (clock_gettime), per-arch macros for the
particular symbol name and version to lookup are added in
syscall_arch.h, and no vdso code is pulled in on archs which do not
define these macros. at this time, vdso is enabled only on x86_64.

the vdso support at the dynamic linker level is no longer useful to
libc, but is left in place for the sake of debuggers (which may need
the vdso in the link map to find its functions) and possibly use with
dlsym.
2014-04-16 02:33:29 -04:00
Rich Felker 805698401d fix fallback code for old kernels in clock_gettime 2014-04-14 23:48:40 -04:00
Rich Felker cdfb725ca3 use weak aliase rather than weak reference for vdso clock_gettime
this works around pcc's lack of working support for weak references,
and in principle is nice because it gets us back to the stage where
the only weak symbol feature we use is weak aliases, nothing else.

having fewer dependencies on fancy linker features is a good thing.
2011-08-07 15:48:16 -04:00
Rich Felker e91c375fd0 workaround for gcc's optimizer breaking dynamic symbol resolution 2011-07-24 01:10:01 -04:00
Rich Felker f7adc39e37 const correctness on function pointer 2011-07-24 00:54:36 -04:00
Rich Felker e3eb49321c some preliminaries for vdso clock support
these changes also make it so clock_gettime(CLOCK_REALTIME, &ts) works
even on pre-2.6 kernels, emulated via the gettimeofday syscall. there
is no cost for the fallback check, as it falls under the error case
that already must be checked for storing the error code in errno, but
which would normally be hidden inside __syscall_ret.
2011-07-23 23:45:33 -04:00
Rich Felker aa398f56fa global cleanup to use the new syscall interface 2011-03-20 00:16:43 -04:00
Rich Felker 1b538acb0a fix errno behavior in clock_* functions
these functions are specified inconsistent in whether they're
specified to return an error value, or return -1 and set errno.
hopefully now they all match what POSIX requires.
2011-03-10 09:54:23 -05:00
Rich Felker 4b1244a0bf implement the remaining clock_* interfaces 2011-02-19 12:43:56 -05:00
Rich Felker 0b44a0315b initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00