summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/sys/linker_set.h
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sys/sys/linker_set.h')
-rw-r--r--freebsd/sys/sys/linker_set.h27
1 files changed, 19 insertions, 8 deletions
diff --git a/freebsd/sys/sys/linker_set.h b/freebsd/sys/sys/linker_set.h
index c403d764..918d7242 100644
--- a/freebsd/sys/sys/linker_set.h
+++ b/freebsd/sys/sys/linker_set.h
@@ -43,16 +43,27 @@
* For ELF, this is done by constructing a separate segment for each set.
*/
+#if defined(__powerpc64__)
+/*
+ * Move the symbol pointer from ".text" to ".data" segment, to make
+ * the GCC compiler happy:
+ */
+#define __MAKE_SET_CONST
+#else
+#define __MAKE_SET_CONST const
+#endif
+
/*
* Private macros, not to be used outside this header file.
*/
#ifdef __GNUCLIKE___SECTION
#ifndef __rtems__
-#define __MAKE_SET(set, sym) \
- __GLOBL(__CONCAT(__start_set_,set)); \
- __GLOBL(__CONCAT(__stop_set_,set)); \
- static void const * const __set_##set##_sym_##sym \
- __section("set_" #set) __used = &sym
+#define __MAKE_SET(set, sym) \
+ __GLOBL(__CONCAT(__start_set_,set)); \
+ __GLOBL(__CONCAT(__stop_set_,set)); \
+ static void const * __MAKE_SET_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] \
@@ -111,9 +122,9 @@
* Initialize before referring to a given linker set.
*/
#ifndef __rtems__
-#define SET_DECLARE(set, ptype) \
- extern ptype *__CONCAT(__start_set_,set); \
- extern ptype *__CONCAT(__stop_set_,set)
+#define SET_DECLARE(set, ptype) \
+ extern ptype __weak_symbol *__CONCAT(__start_set_,set); \
+ extern ptype __weak_symbol *__CONCAT(__stop_set_,set)
#define SET_BEGIN(set) \
(&__CONCAT(__start_set_,set))