[rtems-libbsd commit] Prevent invalid optimizations for linker sets
Sebastian Huber
sebh at rtems.org
Wed Apr 27 12:20:33 UTC 2016
Module: rtems-libbsd
Branch: master
Commit: 4e07ea5063647ef22666804d30817fbd2c64d7e8
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=4e07ea5063647ef22666804d30817fbd2c64d7e8
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Wed Apr 27 14:18:36 2016 +0200
Prevent invalid optimizations for linker sets
---
freebsd/sys/sys/linker_set.h | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/freebsd/sys/sys/linker_set.h b/freebsd/sys/sys/linker_set.h
index 35baa89..1d64e11 100644
--- a/freebsd/sys/sys/linker_set.h
+++ b/freebsd/sys/sys/linker_set.h
@@ -51,35 +51,35 @@
static void const * const __set_##set##_sym_##sym \
__section("set_" #set) __used = &sym
#else /* __rtems__ */
-#define RTEMS_BSD_DEFINE_SET(set, type) \
- type const __CONCAT(_bsd__start_set_,set)[0] \
- __section(".rtemsroset.bsd." __STRING(set) ".begin") __used; \
- type const __CONCAT(_bsd__stop_set_,set)[0] \
+#define RTEMS_BSD_DEFINE_SET(set, type) \
+ type volatile const __CONCAT(_bsd__start_set_,set)[0] \
+ __section(".rtemsroset.bsd." __STRING(set) ".begin") __used; \
+ type volatile const __CONCAT(_bsd__stop_set_,set)[0] \
__section(".rtemsroset.bsd." __STRING(set) ".end") __used
#define RTEMS_BSD_DECLARE_SET(set, type) \
- extern type const __CONCAT(_bsd__start_set_,set)[0]; \
- extern type const __CONCAT(_bsd__stop_set_,set)[0]
+ extern type volatile const __CONCAT(_bsd__start_set_,set)[0]; \
+ extern type volatile const __CONCAT(_bsd__stop_set_,set)[0]
#define RTEMS_BSD_DEFINE_SET_ITEM(set, sym, type) \
- static type const __set_##set##_sym_##sym \
+ static type volatile const __set_##set##_sym_##sym \
__section(".rtemsroset.bsd." __STRING(set) ".content") __used
#define __MAKE_SET(set, sym) \
RTEMS_BSD_DEFINE_SET_ITEM(set, sym, const void *) = &sym
#define RTEMS_BSD_DEFINE_RWSET(set, type) \
- type __CONCAT(_bsd__start_set_,set)[0] \
- __section(".rtemsrwset.bsd." __STRING(set) ".begin") __used; \
+ type __CONCAT(_bsd__start_set_,set)[0] \
+ __section(".rtemsrwset.bsd." __STRING(set) ".begin") __used; \
type __CONCAT(_bsd__stop_set_,set)[0] \
__section(".rtemsrwset.bsd." __STRING(set) ".end") __used
#define RTEMS_BSD_DECLARE_RWSET(set, type) \
- extern type __CONCAT(_bsd__start_set_,set)[0]; \
- extern type __CONCAT(_bsd__stop_set_,set)[0]
+ extern type volatile __CONCAT(_bsd__start_set_,set)[0]; \
+ extern type volatile __CONCAT(_bsd__stop_set_,set)[0]
#define RTEMS_BSD_DEFINE_RWSET_ITEM(set, sym, type) \
- static type __set_##set##_sym_##sym \
+ static type volatile __set_##set##_sym_##sym \
__section(".rtemsrwset.bsd." __STRING(set) ".content") __used
#define __MAKE_RWSET(set, sym) \
More information about the vc
mailing list