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.
This commit is contained in:
Olivier Houchard 2019-04-10 16:21:32 +02:00 committed by Olivier Houchard
parent 86dcad6c62
commit 526dc95eb9
1 changed files with 5 additions and 0 deletions

View 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