summaryrefslogtreecommitdiff
path: root/include/haproxy/initcall.h
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2021-04-10 15:43:17 +0200
committerWilly Tarreau <w@1wt.eu>2021-04-10 19:27:41 +0200
commitafa9bc0ec54c4cda34cf21e3542e417c995eff6c (patch)
treea59374c4dbff8c84e990a44fe45c84169471615f /include/haproxy/initcall.h
parentad14c2681b957039825cfbe78223d4281f4b783c (diff)
downloadhaproxy-afa9bc0ec54c4cda34cf21e3542e417c995eff6c.tar.gz
MINOR: initcall: uniformize the section names between MacOS and other unixes
Due to length restrictions on OSX the initcall sections are called "i_" there while they're called "init_" on other OSes. However the start and end of sections are still called "__start_init_" and "__stop_init_", which forces to have distinct code between the OSes. Let's switch everyone to "i_" and rename the symbols accordingly.
Diffstat (limited to 'include/haproxy/initcall.h')
-rw-r--r--include/haproxy/initcall.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/haproxy/initcall.h b/include/haproxy/initcall.h
index eb7369b93..7066cfcd9 100644
--- a/include/haproxy/initcall.h
+++ b/include/haproxy/initcall.h
@@ -85,7 +85,7 @@ struct initcall {
#ifdef __APPLE__
#define HA_SECTION(s) __section__("__DATA, i_" # s)
#else
-#define HA_SECTION(s) __section__("init_" # s)
+#define HA_SECTION(s) __section__("i_" # s)
#endif
/* Declare a static variable in the init section dedicated to stage <stg>,
@@ -101,8 +101,8 @@ struct initcall {
#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 ); \
+ __GLOBL(__start_i_##stg ); \
+ __GLOBL(__stop_i_##stg ); \
static const struct initcall *__initcb_##linenum \
__attribute__((__used__,HA_SECTION(stg))) = \
(stg < STG_SIZE) ? &(const struct initcall) { \
@@ -179,7 +179,7 @@ __attribute__((constructor)) static void __initcb_##linenum() \
* stage <stg>.
*/
#define FOREACH_INITCALL(p,stg) \
- for ((p) = &(__start_init_##stg); (p) < &(__stop_init_##stg); (p)++)
+ for ((p) = &(__start_i_##stg); (p) < &(__stop_i_##stg); (p)++)
#else // USE_OBSOLETE_LINKER
@@ -197,13 +197,13 @@ __attribute__((constructor)) static void __initcb_##linenum() \
*/
#ifdef __APPLE__
#define DECLARE_INIT_SECTION(stg) \
- extern __attribute__((__weak__)) const struct initcall *__start_init_##stg __asm("section$start$__DATA$i_" # stg); \
- extern __attribute__((__weak__)) const struct initcall *__stop_init_##stg __asm("section$end$__DATA$i_" # stg)
+ extern __attribute__((__weak__)) const struct initcall *__start_i_##stg __asm("section$start$__DATA$i_" # stg); \
+ extern __attribute__((__weak__)) const struct initcall *__stop_i_##stg __asm("section$end$__DATA$i_" # stg)
#else
#define DECLARE_INIT_SECTION(stg) \
- extern __attribute__((__weak__)) const struct initcall *__start_init_##stg; \
- extern __attribute__((__weak__)) const struct initcall *__stop_init_##stg
+ extern __attribute__((__weak__)) const struct initcall *__start_i_##stg; \
+ extern __attribute__((__weak__)) const struct initcall *__stop_i_##stg
#endif
/* Declare all initcall sections here */