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