xref: /freebsd/sys/conf/kmod_syms_prefix.awk (revision 734e82fe33aa764367791a7d603b383996c6b40b)
1
2# Read global symbols from object file.
3BEGIN {
4        while ("${NM:='nm'} " ARGV[1] | getline) {
5                if (match($0, /^[^[:space:]]+ [^AU] (.*)$/)) {
6                        syms[$3] = $2
7                }
8        }
9        delete ARGV[1]
10}
11
12# Strip commons, make everything else local.
13END {
14        for (member in syms) {
15                printf("--redefine-sym=%s=%s%s\n", member, prefix, member);
16        }
17}
18