diff options
author | kib <kib@FreeBSD.org> | 2013-01-30 12:48:16 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-01-30 12:48:16 +0000 |
commit | 3913be8cf6bae0deea4548df2c3655b08fc13966 (patch) | |
tree | 8420271c2048f0f68fc109f9ebcfac2a36b6f164 /lib/libc/amd64 | |
parent | b19d7b3a7d074dab1d31875d6620e3fe26a41666 (diff) | |
download | FreeBSD-src-3913be8cf6bae0deea4548df2c3655b08fc13966.zip FreeBSD-src-3913be8cf6bae0deea4548df2c3655b08fc13966.tar.gz |
Rework the __vdso_* symbols attributes to only make the symbols weak,
but use normal references instead of weak. This makes the statically
linked binaries to use fast gettimeofday(2) by forcing the linker to
resolve references and providing the neccessary functions.
Reported by: bde
Tested by: marius (sparc64)
MFC after: 2 weeks
Diffstat (limited to 'lib/libc/amd64')
-rw-r--r-- | lib/libc/amd64/sys/__vdso_gettc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/libc/amd64/sys/__vdso_gettc.c b/lib/libc/amd64/sys/__vdso_gettc.c index 091fe26..c6f2dfb 100644 --- a/lib/libc/amd64/sys/__vdso_gettc.c +++ b/lib/libc/amd64/sys/__vdso_gettc.c @@ -27,9 +27,11 @@ __FBSDID("$FreeBSD$"); #include <sys/types.h> +#include <sys/elf.h> #include <sys/time.h> #include <sys/vdso.h> #include <machine/cpufunc.h> +#include "libc_private.h" static u_int __vdso_gettc_low(const struct vdso_timehands *th) @@ -41,9 +43,18 @@ __vdso_gettc_low(const struct vdso_timehands *th) return (rv); } +#pragma weak __vdso_gettc u_int __vdso_gettc(const struct vdso_timehands *th) { return (th->th_x86_shift > 0 ? __vdso_gettc_low(th) : rdtsc32()); } + +#pragma weak __vdso_gettimekeep +int +__vdso_gettimekeep(struct vdso_timekeep **tk) +{ + + return (_elf_aux_info(AT_TIMEKEEP, tk, sizeof(*tk))); +} |