*/
SR_PRIV const struct sr_dev_driver *sr_driver_list__start[]
+ SR_DRIVER_LIST_NOREORDER
__attribute__((section (SR_DRIVER_LIST_SECTION),
used, aligned(sizeof(struct sr_dev_driver *))))
= { NULL /* Dummy item, as zero length arrays are not allowed by C99 */ };
*/
SR_PRIV const struct sr_dev_driver *sr_driver_list__stop[]
+ SR_DRIVER_LIST_NOREORDER
__attribute__((section (SR_DRIVER_LIST_SECTION),
used, aligned(sizeof(struct sr_dev_driver *))))
= { NULL /* Dummy item, as zero length arrays are not allowed by C99 */ };
#define SR_DRIVER_LIST_SECTION "__sr_driver_list"
#endif
+#if !defined SR_DRIVER_LIST_NOREORDER && defined __has_attribute
+#if __has_attribute(no_reorder)
+#define SR_DRIVER_LIST_NOREORDER __attribute__((no_reorder))
+#endif
+#endif
+#if !defined SR_DRIVER_LIST_NOREORDER
+#define SR_DRIVER_LIST_NOREORDER /* EMPTY */
+#endif
+
/**
* Register a list of hardware drivers.
*
*/
#define SR_REGISTER_DEV_DRIVER_LIST(name, ...) \
static const struct sr_dev_driver *name[] \
+ SR_DRIVER_LIST_NOREORDER \
__attribute__((section (SR_DRIVER_LIST_SECTION), used, \
aligned(sizeof(struct sr_dev_driver *)))) \
= { \