HardenedBSD/sys/conf/kmod_syms_prefix.awk
Warner Losh 031beb4e23 sys: Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:54:58 -06:00

18 lines
425 B
Awk

# Read global symbols from object file.
BEGIN {
while ("${NM:='nm'} " ARGV[1] | getline) {
if (match($0, /^[^[:space:]]+ [^AU] (.*)$/)) {
syms[$3] = $2
}
}
delete ARGV[1]
}
# Strip commons, make everything else local.
END {
for (member in syms) {
printf("--redefine-sym=%s=%s%s\n", member, prefix, member);
}
}