shared: declare DECLARE_(DL,PTR)SYM as static 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>
diff --git a/shared/util.h b/shared/util.h index 7363f42..5a4256a 100644 --- a/shared/util.h +++ b/shared/util.h
@@ -187,10 +187,10 @@ #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