From b7c6f49364aba8a31ef4a7592cf32ab184297c7d Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 27 Jun 2013 13:52:50 +0000 Subject: [PATCH] tsan: remove non-existent functions from syms file llvm-svn: 185077 --- compiler-rt/lib/tsan/gen_dynamic_list.sh | 11 ++++++++++- compiler-rt/lib/tsan/rtl/tsan.syms | 12 ------------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/compiler-rt/lib/tsan/gen_dynamic_list.sh b/compiler-rt/lib/tsan/gen_dynamic_list.sh index 50e36e767d77..4868b42be243 100755 --- a/compiler-rt/lib/tsan/gen_dynamic_list.sh +++ b/compiler-rt/lib/tsan/gen_dynamic_list.sh @@ -1,6 +1,7 @@ #!/bin/bash set -e +# Collect interceptor names from a source file. function collect() { while read line ; do if [[ $line =~ ^(.*)((TSAN_INTERCEPT|INTERCEPT_FUNCTION)\()([a-z,A-Z,0-9,_]+)(.*)$ ]] ; then @@ -10,6 +11,7 @@ function collect() { done < "$1" } +# Interface functions. results+=" __tsan_init" results+=" __tsan_read*" results+=" __tsan_write*" @@ -40,8 +42,15 @@ collect ../sanitizer_common/sanitizer_common_interceptors.inc results=`for i in $results; do echo $i; done | sort -f` echo "# AUTO GENERATED by compiler-rt/lib/tsan/gen_dynamic_list.sh; EDITING IS FUTILE." echo "{" +NM=`nm rtl/libtsan.a` for i in $results; do - echo " $i;" + # Remove symbols that are not present in the library. + if [[ $NM =~ " $i" ]]; then + echo " $i;" + else if [[ $i == *"*" ]]; then + echo " $i;" + fi + fi done echo "};" diff --git a/compiler-rt/lib/tsan/rtl/tsan.syms b/compiler-rt/lib/tsan/rtl/tsan.syms index 1b65330c4056..111c9348b064 100644 --- a/compiler-rt/lib/tsan/rtl/tsan.syms +++ b/compiler-rt/lib/tsan/rtl/tsan.syms @@ -32,18 +32,13 @@ frexpl; fstat; fstat64; - func; fwrite; - getaddrinfo; - getgrgid; - getgrgid_r; gethostbyname2; gethostbyname2_r; getpeername; getsockname; getsockopt; gettimeofday; - glob64; inet_aton; inet_pton; inotify_init; @@ -89,7 +84,6 @@ pthread_barrier_wait; pthread_cond_broadcast; pthread_cond_destroy; - pthread_cond_init; pthread_cond_signal; pthread_cond_timedwait; pthread_cond_wait; @@ -218,18 +212,13 @@ __interceptor_frexpl; __interceptor_fstat; __interceptor_fstat64; - __interceptor_func; __interceptor_fwrite; - __interceptor_getaddrinfo; - __interceptor_getgrgid; - __interceptor_getgrgid_r; __interceptor_gethostbyname2; __interceptor_gethostbyname2_r; __interceptor_getpeername; __interceptor_getsockname; __interceptor_getsockopt; __interceptor_gettimeofday; - __interceptor_glob64; __interceptor_inet_aton; __interceptor_inet_pton; __interceptor_inotify_init; @@ -275,7 +264,6 @@ __interceptor_pthread_barrier_wait; __interceptor_pthread_cond_broadcast; __interceptor_pthread_cond_destroy; - __interceptor_pthread_cond_init; __interceptor_pthread_cond_signal; __interceptor_pthread_cond_timedwait; __interceptor_pthread_cond_wait;