summaryrefslogtreecommitdiffstats
path: root/sys/conf/kmod_syms.awk
blob: 3aa3eeb61f5213b0acb750362e4746866c82df1f (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
# $FreeBSD$

# Read global symbols from object file.
BEGIN {
        while ("nm -g " ARGV[1] | getline) {
                if (match($0, /^[^[:space:]]+ [^AU] (.*)$/)) {
                        syms[$3] = $2
                }
        }
}

# De-list symbols from the export list.
// {
        if (ARGIND == 1)
                nextfile
        delete syms[$0]
}

# Strip commons, make everything else local.
END {
        for (member in syms) {
                if (syms[member] == "C")
                        print "-N" member
                else
                        print "-L" member
        }
}
OpenPOWER on IntegriCloud