mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-21 11:13:30 +00:00
ab6fc18e52
to parse the binary .kld file as a list of symbols. Fix this by simply deleting the unwanted argument from the ARGV[] array instead of trying to skip over it.
27 lines
579 B
Awk
27 lines
579 B
Awk
# $FreeBSD$
|
|
|
|
# Read global symbols from object file.
|
|
BEGIN {
|
|
while ("${NM:='nm'} -g " ARGV[1] | getline) {
|
|
if (match($0, /^[^[:space:]]+ [^AU] (.*)$/)) {
|
|
syms[$3] = $2
|
|
}
|
|
}
|
|
delete ARGV[1]
|
|
}
|
|
|
|
# De-list symbols from the export list.
|
|
{
|
|
delete syms[$0]
|
|
}
|
|
|
|
# Strip commons, make everything else local.
|
|
END {
|
|
for (member in syms) {
|
|
if (syms[member] == "C")
|
|
print "-N" member
|
|
else
|
|
print "-L" member
|
|
}
|
|
}
|