]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
shared: declare DECLARE_(DL,PTR)SYM as static
authorEmil Velikov <emil.l.velikov@gmail.com>
Sat, 24 May 2025 18:09:06 +0000 (19:09 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 30 May 2025 02:16:00 +0000 (21:16 -0500)
Declare the symbol pointers as static, otherwise the compiler will add
them to the data section instead of bss.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/358
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
shared/util.h

index 7363f4267eac58d7f1ddc88fc7adf850b4d01efb..5a4256a2777fa4d85dcd879c9b7498c54efae525 100644 (file)
@@ -187,10 +187,10 @@ _sentinel_ int dlsym_many(void **dlp, const char *filename, ...);
 #define DLSYM_ARG(symbol__) &sym_##symbol__, STRINGIFY(symbol__),
 
 /* For symbols being dynamically loaded */
-#define DECLARE_DLSYM(symbol) typeof(symbol) *sym_##symbol = NULL
+#define DECLARE_DLSYM(symbol) static typeof(symbol) *sym_##symbol = NULL
 
 /* Pointer indirection to support linking directly */
-#define DECLARE_PTRSYM(symbol) typeof(symbol) *sym_##symbol = symbol
+#define DECLARE_PTRSYM(symbol) static typeof(symbol) *sym_##symbol = symbol
 
 /*
  * Helper defines, to be done locally before including this header to switch between