summaryrefslogtreecommitdiff
path: root/tools/checkglobals
blob: c20d94f15dae2f3588d6b2cbe0c3b4b85be57909 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
#
# Check for global symbols that don't need to be made global...
#

for file in *.o; do
	echo -n "$file: "

	functions=""

	for function in `nm -g $file | grep "T " | awk '{print $3}'`; do
		found=""
		for file2 in *.o; do
			if test "$file" = "$file2"; then
				continue;
			fi

			found=`nm -g $file2 | grep $function`
			if test "$found" != ""; then
				break;
			fi
		done

		if test -z "$found"; then
			functions="$functions $function"
		fi
	done

	if test -z "$functions"; then
		echo "OK"
	else
		echo $functions
	fi
done