1# Check that the libc.so for all platforms, and all architectures 2# Does not export 'atexit' and '__dso_handle' symbols. 3# 4LIBRARIES=$(cd $NDK && find platforms -name "libc.so" | sed -e 's!^!'$NDK'/!') 5FAILURE= 6COUNT=0 7for LIB in $LIBRARIES; do 8 COUNT=$(( $COUNT + 1 )) 9 echo "Checking: $LIB" 10 readelf -s $LIB | grep -q -F " atexit" 11 if [ $? = 0 ]; then 12 echo "ERROR: $NDK/$LIB exposes 'atexit'!" >&2 13 FAILURE=true 14 fi 15 readelf -s $LIB | grep -q -F " __dso_handle" 16 if [ $? = 0 ]; then 17 echo "ERROR: $NDK/$LIB exposes '__dso_handle'!" >&2 18 FAILURE=true 19 fi 20done 21 22if [ "$COUNT" = 0 ]; then 23 echo "ERROR: Did not find any libc.so in $NDK/platforms!" 24 exit 1 25fi 26 27if [ "$FAILURE" ]; then 28 exit 1 29else 30 echo "All $COUNT libc.so are ok!" 31 exit 0 32fi 33