diff --git a/include/haproxy/bug.h b/include/haproxy/bug.h index 71b37eda69..997a114600 100644 --- a/include/haproxy/bug.h +++ b/include/haproxy/bug.h @@ -234,8 +234,8 @@ struct mem_stats { .file = __FILE__, .line = __LINE__, \ .type = MEM_STATS_TYPE_CALLOC, \ }; \ - __asm__(".globl __start_mem_stats"); \ - __asm__(".globl __stop_mem_stats"); \ + __asm__(".weak __start_mem_stats"); \ + __asm__(".weak __stop_mem_stats"); \ _HA_ATOMIC_INC(&_.calls); \ _HA_ATOMIC_ADD(&_.size, __x * __y); \ calloc(__x,__y); \ @@ -251,8 +251,8 @@ struct mem_stats { .file = __FILE__, .line = __LINE__, \ .type = MEM_STATS_TYPE_FREE, \ }; \ - __asm__(".globl __start_mem_stats"); \ - __asm__(".globl __stop_mem_stats"); \ + __asm__(".weak __start_mem_stats"); \ + __asm__(".weak __stop_mem_stats"); \ if (__x) \ _HA_ATOMIC_INC(&_.calls); \ free(__x); \ @@ -265,8 +265,8 @@ struct mem_stats { .file = __FILE__, .line = __LINE__, \ .type = MEM_STATS_TYPE_FREE, \ }; \ - __asm__(".globl __start_mem_stats"); \ - __asm__(".globl __stop_mem_stats"); \ + __asm__(".weak __start_mem_stats"); \ + __asm__(".weak __stop_mem_stats"); \ if (__builtin_constant_p((x)) || __builtin_constant_p(*(x))) { \ HA_LINK_ERROR(call_to_ha_free_attempts_to_free_a_constant); \ } \ @@ -283,8 +283,8 @@ struct mem_stats { .file = __FILE__, .line = __LINE__, \ .type = MEM_STATS_TYPE_MALLOC, \ }; \ - __asm__(".globl __start_mem_stats"); \ - __asm__(".globl __stop_mem_stats"); \ + __asm__(".weak __start_mem_stats"); \ + __asm__(".weak __stop_mem_stats"); \ _HA_ATOMIC_INC(&_.calls); \ _HA_ATOMIC_ADD(&_.size, __x); \ malloc(__x); \ @@ -297,8 +297,8 @@ struct mem_stats { .file = __FILE__, .line = __LINE__, \ .type = MEM_STATS_TYPE_REALLOC, \ }; \ - __asm__(".globl __start_mem_stats"); \ - __asm__(".globl __stop_mem_stats"); \ + __asm__(".weak __start_mem_stats"); \ + __asm__(".weak __stop_mem_stats"); \ _HA_ATOMIC_INC(&_.calls); \ _HA_ATOMIC_ADD(&_.size, __y); \ realloc(__x,__y); \ @@ -311,8 +311,8 @@ struct mem_stats { .file = __FILE__, .line = __LINE__, \ .type = MEM_STATS_TYPE_STRDUP, \ }; \ - __asm__(".globl __start_mem_stats"); \ - __asm__(".globl __stop_mem_stats"); \ + __asm__(".weak __start_mem_stats"); \ + __asm__(".weak __stop_mem_stats"); \ _HA_ATOMIC_INC(&_.calls); \ _HA_ATOMIC_ADD(&_.size, __y); \ strdup(__x); \