1# $FreeBSD$ 2 3# Read global symbols from object file. 4BEGIN { 5 while ("nm -g " ARGV[1] | getline) { 6 if (match($0, /^[^[:space:]]+ [^AU] (.*)$/)) { 7 syms[$3] = $2 8 } 9 } 10} 11 12# De-list symbols from the export list. 13// { 14 if (ARGIND == 1) 15 nextfile 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} 28