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