Browse Source

linuxkm: use EXPORT_SYMBOL_NS(x, WOLFSSL) if available, else fall back to EXPORT_SYMBOL(x).

Daniel Pouzzner 3 years ago
parent
commit
b468ea77ea
2 changed files with 6 additions and 2 deletions
  1. 2 2
      linuxkm/Kbuild
  2. 4 0
      linuxkm/module_exports.c.template

+ 2 - 2
linuxkm/Kbuild

@@ -83,9 +83,9 @@ $(src)/linuxkm/module_exports.c: $(src)/linuxkm/module_exports.c.template $(WOLF
 		awk '/^ *[0-9]+: / {							\
 		  if ($$8 !~ /^(wc_|wolf)/){next;}					\
 		  if (($$4 == "FUNC") && ($$5 == "GLOBAL") && ($$6 == "DEFAULT")) {	\
-		    print "EXPORT_SYMBOL(" $$8 ");";	      	      		  	\
+		    print "EXPORT_SYMBOL_NS(" $$8 ", WOLFSSL);";    		  	\
 		  }									\
 		}' >> $@
-	@echo -e '#ifndef NO_CRYPT_TEST\nEXPORT_SYMBOL(wolfcrypt_test);\n#endif' >> $@
+	@echo -e '#ifndef NO_CRYPT_TEST\nEXPORT_SYMBOL_NS(wolfcrypt_test, WOLFSSL);\n#endif' >> $@
 
 clean-files := module_exports.c

+ 4 - 0
linuxkm/module_exports.c.template

@@ -33,6 +33,10 @@
 #include <linux/delay.h>
 #endif
 
+#ifndef EXPORT_SYMBOL_NS
+#define EXPORT_SYMBOL_NS(sym, ns) EXPORT_SYMBOL(sym)
+#endif
+
 #include <wolfssl/wolfcrypt/memory.h>
 #include <wolfssl/wolfcrypt/wc_port.h>
 #include <wolfssl/wolfcrypt/logging.h>