1 # Check that the libc.so for all platforms, and all architectures 2 # Does not export 'atexit' and '__dso_handle' symbols. 3 # 4 LIBRARIES=$(cd $NDK && find platforms -name "libc.so" | sed -e 's!^!'$NDK'/!') 5 FAILURE= 6 COUNT=0 7 for 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 20 done 21 22 if [ "$COUNT" = 0 ]; then 23 echo "ERROR: Did not find any libc.so in $NDK/platforms!" 24 exit 1 25 fi 26 27 if [ "$FAILURE" ]; then 28 exit 1 29 else 30 echo "All $COUNT libc.so are ok!" 31 exit 0 32 fi 33