xref: /freebsd/sys/conf/kmod_syms_prefix.awk (revision 43a5ec4eb41567cc92586503212743d89686d78f)
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