summaryrefslogtreecommitdiff
path: root/usr/src/uts/common
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2022-10-07 15:06:57 +0300
committerToomas Soome <tsoome@me.com>2022-11-07 18:53:06 +0200
commitd56b5f9f1e06794379c22afb6e6ba0ac704e4214 (patch)
treeb420e0ed7f9001a58c866bb5318322ba324a7d97 /usr/src/uts/common
parentf8e30ca2ec5c9a7f5bd81df127b915fdc6bb0c1a (diff)
downloadillumos-joyent-d56b5f9f1e06794379c22afb6e6ba0ac704e4214.tar.gz
15067 linker set should be declared WEAK
Reviewed by: Jason King <jason.brian.king+illumos@gmail.com> Reviewed by: Patrick Mooney <pmooney@pfmooney.com> Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Diffstat (limited to 'usr/src/uts/common')
-rw-r--r--usr/src/uts/common/sys/linker_set.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr/src/uts/common/sys/linker_set.h b/usr/src/uts/common/sys/linker_set.h
index 44934bcd97..872e560c2d 100644
--- a/usr/src/uts/common/sys/linker_set.h
+++ b/usr/src/uts/common/sys/linker_set.h
@@ -41,14 +41,17 @@
#define __CONCAT1(x, y) x ## y
#define __CONCAT(x, y) __CONCAT1(x, y)
-#define __GLOBL1(sym) __asm__(".globl " #sym)
-#define __GLOBL(sym) __GLOBL1(sym)
+#define __STRING(x) #x /* stringify without expanding x */
+#define __XSTRING(x) __STRING(x) /* expand x, then stringify */
+
+#define __GLOBL(sym) __asm__(".globl " __XSTRING(sym))
+#define __WEAK(sym) __asm__(".weak " __XSTRING(sym))
/*
* Private macros, not to be used outside this header file.
*/
#define __MAKE_SET(set, sym) \
- __GLOBL(__CONCAT(__start_set_, set)); \
- __GLOBL(__CONCAT(__stop_set_, set)); \
+ __WEAK(__CONCAT(__start_set_, set)); \
+ __WEAK(__CONCAT(__stop_set_, set)); \
static void const * __MAKE_SET_CONST \
__set_##set##_sym_##sym __section("set_" #set) \
__used = &(sym)