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