]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: initcall: Don't forget to define the __start/stop_init_##stg symbols.
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 10 Apr 2019 14:21:32 +0000 (16:21 +0200)
committerOlivier Houchard <cognet@ci0.org>
Wed, 10 Apr 2019 14:33:25 +0000 (16:33 +0200)
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.

include/common/initcall.h

index cf3febb68e2ebfb1149c6bd15b03954590c79277..6da752ce60f2aa813128f63c2d1d3f7f89586e59 100644 (file)
@@ -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