1#!/bin/sh
2#
3# Check for global symbols that don't need to be made global...
4#
5
6for file in *.o; do
7	functions=""
8
9	for function in `nm -g $file | grep "T " | awk '{print $3}'`; do
10		found=""
11		for file2 in *.o; do
12			if test "$file" = "$file2"; then
13				continue;
14			fi
15
16			found=`nm -g $file2 | grep $function`
17			if test "$found" != ""; then
18				break;
19			fi
20		done
21
22		if test -z "$found"; then
23			functions="$functions $function"
24		fi
25	done
26
27	if test -z "$functions"; then
28		echo "$file: OK"
29	else
30		echo "$file: $functions"
31	fi
32done
33