]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: initcall: mark the __start_i_* symbols as weak, not global
authorWilly Tarreau <w@1wt.eu>
Wed, 13 Apr 2022 15:12:20 +0000 (17:12 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 13 Apr 2022 17:13:49 +0000 (19:13 +0200)
Just like for previous fix, these symbols are marked ".globl" during
their declaration, but their later mention uses __attribute__((weak)),
so it's better to only use ".weak" during the declaration so that the
symbol's class does not change.

No need to backport this unless someone reports build issues.

include/haproxy/initcall.h

index 1ffbabf570581500031f5875658509ec90512f23..0692d27d6cc4bfb1e93130a66b59d274441bfccb 100644 (file)
@@ -96,7 +96,7 @@ struct initcall {
  * as a pointer (args are cast to (void*)). Do not use this macro directly,
  * use INITCALL{0..3}() instead.
  */
-#define __HA_GLOBL1(sym)   __asm__(".globl " #sym)
+#define __HA_GLOBL1(sym)   __asm__(".weak " #sym)
 #define __HA_GLOBL(sym)    __HA_GLOBL1(sym)
 #define __DECLARE_INITCALL(stg, linenum, function, a1, a2, a3)     \
         __HA_GLOBL(__start_i_##stg );                              \