aboutsummaryrefslogtreecommitdiff
path: root/gprofng/libcollector/dispatcher.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2022-03-14 14:46:25 -0700
committerH.J. Lu <hjl.tools@gmail.com>2022-03-16 06:45:06 -0700
commitf4be26838dc9937a4ae3e9cf4fbec50efd7786a2 (patch)
treece206b7152f6f242e4a9e56e378b41f4ed5dd694 /gprofng/libcollector/dispatcher.c
parent61a1f2e71118206dd700fc1ddf244b2178bf6610 (diff)
downloadfsf-binutils-gdb-f4be26838dc9937a4ae3e9cf4fbec50efd7786a2.zip
fsf-binutils-gdb-f4be26838dc9937a4ae3e9cf4fbec50efd7786a2.tar.gz
fsf-binutils-gdb-f4be26838dc9937a4ae3e9cf4fbec50efd7786a2.tar.bz2
gprofng: Use symver attribute if available
Use symver attribute if available, instead of asm statement, to support LTO build. PR gprof/28962 * libcollector/dispatcher.c (timer_create@@GLIBC_2.3.3): Use SYMVER_ATTRIBUTE. (timer_create@GLIBC_2.2): Likewise. (timer_create@GLIBC_2.2.5): Likewise. (pthread_create@@GLIBC_2.1): Likewise. (pthread_create@GLIBC_2.0): Likewise. * libcollector/iotrace.c (open64@@GLIBC_2.2): Likewise. (open64@GLIBC_2.1): Likewise. (fopen@@GLIBC_2.1): Likewise. (fopen@GLIBC_2.0): Likewise. (fclose@@GLIBC_2.1): Likewise. (fclose@GLIBC_2.0): Likewise. (fdopen@@GLIBC_2.1): Likewise. (fdopen@GLIBC_2.0): Likewise. (pread@@GLIBC_2.2): Likewise. (pread@GLIBC_2.1): Likewise. (pwrite@@GLIBC_2.2): Likewise. (pwrite@GLIBC_2.1): Likewise. (pwrite64@@GLIBC_2.2): Likewise. (pwrite64@GLIBC_2.1): Likewise. (fgetpos@@GLIBC_2.2): Likewise. (fgetpos@GLIBC_2.0): Likewise. (fgetpos64@@GLIBC_2.2): Likewise. (fgetpos64@GLIBC_2.1): Likewise. (fsetpos@@GLIBC_2.2): Likewise. (fsetpos@GLIBC_2.0): Likewise. (fsetpos64@@GLIBC_2.2): Likewise. (fsetpos64@GLIBC_2.1): Likewise. * libcollector/linetrace.c (posix_spawn@@GLIBC_2.15): Likewise. (posix_spawn@GLIBC_2.2): Likewise. (posix_spawn@GLIBC_2.2.5): Likewise. (posix_spawnp@@GLIBC_2.15): Likewise. (posix_spawnp@GLIBC_2.2): Likewise. (posix_spawnp@GLIBC_2.2.5): Likewise. (popen@@GLIBC_2.1): Likewise. (popen@GLIBC_2.0): Likewise. (_popen@@GLIBC_2.1): Likewise. (_popen@GLIBC_2.0): Likewise. * libcollector/mmaptrace.c (dlopen@@GLIBC_2.1): Likewise. (dlopen@GLIBC_2.0): Likewise. * libcollector/synctrace.c (pthread_cond_wait@@GLIBC_2.3.2): Likewise. (pthread_cond_wait@GLIBC_2.0): Likewise. (pthread_cond_wait@GLIBC_2.2.5): Likewise. (pthread_cond_wait@GLIBC_2.2): Likewise. (pthread_cond_timedwait@@GLIBC_2.3.2): Likewise. (pthread_cond_timedwait@GLIBC_2.0): Likewise. (pthread_cond_timedwait@GLIBC_2.2.5): Likewise. (pthread_cond_timedwait@GLIBC_2.2): Likewise. (sem_wait@@GLIBC_2.1): Likewise. (sem_wait@GLIBC_2.0): Likewise. * src/collector_module.h (SYMVER_ATTRIBUTE): New.
Diffstat (limited to 'gprofng/libcollector/dispatcher.c')
-rw-r--r--gprofng/libcollector/dispatcher.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/gprofng/libcollector/dispatcher.c b/gprofng/libcollector/dispatcher.c
index f9a7de1..f030860 100644
--- a/gprofng/libcollector/dispatcher.c
+++ b/gprofng/libcollector/dispatcher.c
@@ -818,6 +818,7 @@ static int
__collector_timer_create_symver (int(real_timer_create) (), clockid_t clockid, struct sigevent *sevp,
timer_t *timerid);
+SYMVER_ATTRIBUTE (__collector_timer_create_2_3_3, timer_create@@GLIBC_2.3.3)
int
__collector_timer_create_2_3_3 (clockid_t clockid, struct sigevent *sevp,
timer_t *timerid)
@@ -827,11 +828,11 @@ __collector_timer_create_2_3_3 (clockid_t clockid, struct sigevent *sevp,
TprintfT (DBG_LTT, "dispatcher: GLIBC: __collector_timer_create_2_3_3@%p\n", CALL_REAL (timer_create_2_3_3));
return __collector_timer_create_symver (CALL_REAL (timer_create_2_3_3), clockid, sevp, timerid);
}
-__asm__(".symver __collector_timer_create_2_3_3,timer_create@@GLIBC_2.3.3");
#endif /* ARCH(SPARC) || ARCH(Intel)*/
#if ARCH(SPARC)
+SYMVER_ATTRIBUTE (__collector_timer_create_2_2, timer_create@GLIBC_2.2)
int
__collector_timer_create_2_2 (clockid_t clockid, struct sigevent *sevp,
timer_t *timerid)
@@ -842,10 +843,9 @@ __collector_timer_create_2_2 (clockid_t clockid, struct sigevent *sevp,
return __collector_timer_create_symver (CALL_REAL (timer_create_2_2), clockid, sevp, timerid);
}
-__asm__(".symver __collector_timer_create_2_2,timer_create@GLIBC_2.2");
-
#elif ARCH(Intel)
+SYMVER_ATTRIBUTE (__collector_timer_create_2_2_5, timer_create@GLIBC_2.2.5)
int
__collector_timer_create_2_2_5 (clockid_t clockid, struct sigevent *sevp,
timer_t *timerid)
@@ -855,7 +855,6 @@ __collector_timer_create_2_2_5 (clockid_t clockid, struct sigevent *sevp,
TprintfT (DBG_LTT, "dispatcher: GLIBC: __collector_timer_create_2_2_5@%p\n", CALL_REAL (timer_create_2_2_5));
return __collector_timer_create_symver (CALL_REAL (timer_create_2_2_5), clockid, sevp, timerid);
}
-__asm__(".symver __collector_timer_create_2_2_5,timer_create@GLIBC_2.2.5");
#endif /* ARCH() */
#endif /* WSIZE(64) */
@@ -1079,6 +1078,7 @@ __collector_pthread_create_symver (int(real_pthread_create) (),
void *(*func)(void*),
void *arg);
+SYMVER_ATTRIBUTE (__collector_pthread_create_2_1, pthread_create@@GLIBC_2.1)
int
__collector_pthread_create_2_1 (pthread_t *thread,
const pthread_attr_t *attr,
@@ -1091,6 +1091,7 @@ __collector_pthread_create_2_1 (pthread_t *thread,
return __collector_pthread_create_symver (CALL_REAL (pthread_create_2_1), thread, attr, func, arg);
}
+SYMVER_ATTRIBUTE (__collector_pthread_create_2_0, pthread_create@GLIBC_2.0)
int
__collector_pthread_create_2_0 (pthread_t *thread,
const pthread_attr_t *attr,
@@ -1103,9 +1104,6 @@ __collector_pthread_create_2_0 (pthread_t *thread,
return __collector_pthread_create_symver (CALL_REAL (pthread_create_2_0), thread, attr, func, arg);
}
-__asm__(".symver __collector_pthread_create_2_1,pthread_create@@GLIBC_2.1");
-__asm__(".symver __collector_pthread_create_2_0,pthread_create@GLIBC_2.0");
-
#endif
#if ARCH(Intel) && WSIZE(32)