From f85fa27058eb7d4b56b8deaf885064cf8d730f68 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 9 Aug 2012 16:04:37 -0700 Subject: Avoid DWARF definition DIE on ifunc symbols --- sysdeps/unix/sysv/linux/x86_64/time.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'sysdeps/unix/sysv/linux/x86_64') diff --git a/sysdeps/unix/sysv/linux/x86_64/time.c b/sysdeps/unix/sysv/linux/x86_64/time.c index 0e05ddd523..65703cab90 100644 --- a/sysdeps/unix/sysv/linux/x86_64/time.c +++ b/sysdeps/unix/sysv/linux/x86_64/time.c @@ -16,11 +16,20 @@ . */ #ifdef SHARED +/* Redefine time so that the compiler won't complain about the type + mismatch with the IFUNC selector in strong_alias, below. */ +#undef time +#define time __redirect_time +#include + #include #define VSYSCALL_ADDR_vtime 0xffffffffff600400 -void *time_ifunc (void) __asm__ ("time"); +/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle + ifunc symbol properly. */ +extern __typeof (__redirect_time) __libc_time; +void *time_ifunc (void) __asm__ ("__libc_time"); void * time_ifunc (void) @@ -30,7 +39,11 @@ time_ifunc (void) /* If the vDSO is not available we fall back on the old vsyscall. */ return _dl_vdso_vsym ("__vdso_time", &linux26) ?: (void *) VSYSCALL_ADDR_vtime; } -__asm (".type time, %gnu_indirect_function"); +__asm (".type __libc_time, %gnu_indirect_function"); + +#undef time +strong_alias (__libc_time, time) +libc_hidden_ver (__libc_time, time) #else @@ -45,5 +58,3 @@ time (time_t *t) } #endif - -strong_alias (time, __GI_time) -- cgit 1.4.1