xref: /freebsd/sys/conf/kmod_syms.awk (revision 1e413cf93298b5b97441a21d9a50fdcd0ee9945e)
1# $FreeBSD$
2
3# Read global symbols from object file.
4BEGIN {
5        while ("${NM:='nm'} -g " ARGV[1] | getline) {
6                if (match($0, /^[^[:space:]]+ [^AU] (.*)$/)) {
7                        syms[$3] = $2
8                }
9        }
10        delete ARGV[1]
11}
12
13# De-list symbols from the export list.
14{
15        delete syms[$0]
16}
17
18# Strip commons, make everything else local.
19END {
20        for (member in syms) {
21                if (syms[member] == "C")
22                        print "-N" member
23                else
24                        print "-L" member
25        }
26}
27