- extern struct tracepoint __start___tracepoints[] __attribute__((weak, visibility("hidden"))); \
- extern struct tracepoint __stop___tracepoints[] __attribute__((weak, visibility("hidden"))); \
- static void __attribute__((constructor)) __tracepoints__init(void) \
- { \
- tracepoint_register_lib(__start___tracepoints, \
- (((long)__stop___tracepoints)-((long)__start___tracepoints))/sizeof(struct tracepoint)); \
- } \
- \
- static void __attribute__((destructor)) __tracepoints__destroy(void) \
- { \
- tracepoint_unregister_lib(__start___tracepoints); \
+ extern struct tracepoint * const __start___tracepoints_ptrs[] __attribute__((weak, visibility("hidden"))); \
+ extern struct tracepoint * const __stop___tracepoints_ptrs[] __attribute__((weak, visibility("hidden"))); \
+ static struct tracepoint * const __tracepoint_ptr_dummy \
+ __attribute__((used, section("__tracepoints_ptrs"))) = NULL; \
+ static void __attribute__((constructor)) __tracepoints__init(void) \
+ { \
+ tracepoint_register_lib(__start___tracepoints_ptrs, \
+ __stop___tracepoints_ptrs - \
+ __start___tracepoints_ptrs); \
+ } \
+ \
+ static void __attribute__((destructor)) __tracepoints__destroy(void) \
+ { \
+ tracepoint_unregister_lib(__start___tracepoints_ptrs); \