From: Olivier Houchard Date: Wed, 10 Apr 2019 14:21:32 +0000 (+0200) Subject: MINOR: initcall: Don't forget to define the __start/stop_init_##stg symbols. X-Git-Tag: v2.0-dev3~325 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=526dc95eb988bde789f2b1c3e7ea24e0f3dfc540;p=thirdparty%2Fhaproxy.git MINOR: initcall: Don't forget to define the __start/stop_init_##stg symbols. When creating a new initcall, don't forget to define the symbols, as it may not be done automatically and that would lead to undefined symbols. This should be backported to 1.9. --- diff --git a/include/common/initcall.h b/include/common/initcall.h index cf3febb68e..6da752ce60 100644 --- a/include/common/initcall.h +++ b/include/common/initcall.h @@ -98,7 +98,11 @@ struct initcall { * as a pointer (args are cast to (void*)). Do not use this macro directly, * use INITCALL{0..3}() instead. */ +#define __GLOBL1(sym) __asm__(".globl " #sym) +#define __GLOBL(sym) __GLOBL1(sym) #define __DECLARE_INITCALL(stg, linenum, function, a1, a2, a3) \ + __GLOBL(__start_init_##stg ); \ + __GLOBL(__stop_init_##stg ); \ static const struct initcall *__initcb_##linenum \ __attribute__((__used__,HA_SECTION(stg))) = \ (stg < STG_SIZE) ? &(const struct initcall) { \ @@ -108,6 +112,7 @@ struct initcall { .arg3 = (void *)(a3), \ } : NULL + #else // USE_OBSOLETE_LINKER /* Declare a static constructor function to register a static descriptor for