From: Emil Velikov Date: Sat, 24 May 2025 18:09:06 +0000 (+0100) Subject: shared: declare DECLARE_(DL,PTR)SYM as static X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e3acc663637f0eb3a04d69dc3e8285e2a3e2b903;p=thirdparty%2Fkmod.git 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 Link: https://github.com/kmod-project/kmod/pull/358 Signed-off-by: Lucas De Marchi --- diff --git a/shared/util.h b/shared/util.h index 7363f426..5a4256a2 100644 --- a/shared/util.h +++ b/shared/util.h @@ -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