summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2013-01-30 12:48:16 +0000
committerkib <kib@FreeBSD.org>2013-01-30 12:48:16 +0000
commit3913be8cf6bae0deea4548df2c3655b08fc13966 (patch)
tree8420271c2048f0f68fc109f9ebcfac2a36b6f164 /lib/libc/sys
parentb19d7b3a7d074dab1d31875d6620e3fe26a41666 (diff)
downloadFreeBSD-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/sys')
-rw-r--r--lib/libc/sys/__vdso_gettimeofday.c4
-rw-r--r--lib/libc/sys/gettimeofday.c5
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/libc/sys/__vdso_gettimeofday.c b/lib/libc/sys/__vdso_gettimeofday.c
index 32abb69..a305173 100644
--- a/lib/libc/sys/__vdso_gettimeofday.c
+++ b/lib/libc/sys/__vdso_gettimeofday.c
@@ -79,6 +79,7 @@ binuptime(struct bintime *bt, struct vdso_timekeep *tk, int abs)
static struct vdso_timekeep *tk;
+#pragma weak __vdso_gettimeofday
int
__vdso_gettimeofday(struct timeval *tv, struct timezone *tz)
{
@@ -88,7 +89,7 @@ __vdso_gettimeofday(struct timeval *tv, struct timezone *tz)
if (tz != NULL)
return (ENOSYS);
if (tk == NULL) {
- error = _elf_aux_info(AT_TIMEKEEP, &tk, sizeof(tk));
+ error = __vdso_gettimekeep(&tk);
if (error != 0 || tk == NULL)
return (ENOSYS);
}
@@ -101,6 +102,7 @@ __vdso_gettimeofday(struct timeval *tv, struct timezone *tz)
return (0);
}
+#pragma weak __vdso_clock_gettime
int
__vdso_clock_gettime(clockid_t clock_id, struct timespec *ts)
{
diff --git a/lib/libc/sys/gettimeofday.c b/lib/libc/sys/gettimeofday.c
index 4cc87e1..5b12523 100644
--- a/lib/libc/sys/gettimeofday.c
+++ b/lib/libc/sys/gettimeofday.c
@@ -41,10 +41,7 @@ __gettimeofday(struct timeval *tv, struct timezone *tz)
{
int error;
- if (__vdso_gettimeofday != NULL && __vdso_gettc != NULL)
- error = __vdso_gettimeofday(tv, tz);
- else
- error = ENOSYS;
+ error = __vdso_gettimeofday(tv, tz);
if (error == ENOSYS)
error = __sys_gettimeofday(tv, tz);
return (error);
OpenPOWER on IntegriCloud