summaryrefslogtreecommitdiffstats
path: root/sys/conf/kmod_syms.awk
diff options
context:
space:
mode:
Diffstat (limited to 'sys/conf/kmod_syms.awk')
-rw-r--r--sys/conf/kmod_syms.awk27
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/conf/kmod_syms.awk b/sys/conf/kmod_syms.awk
new file mode 100644
index 0000000..3aa3eeb
--- /dev/null
+++ b/sys/conf/kmod_syms.awk
@@ -0,0 +1,27 @@
+# $FreeBSD$
+
+# Read global symbols from object file.
+BEGIN {
+ while ("nm -g " ARGV[1] | getline) {
+ if (match($0, /^[^[:space:]]+ [^AU] (.*)$/)) {
+ syms[$3] = $2
+ }
+ }
+}
+
+# De-list symbols from the export list.
+// {
+ if (ARGIND == 1)
+ nextfile
+ 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
+ }
+}
OpenPOWER on IntegriCloud