diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -566,6 +566,9 @@ #define __GLOBL1(sym) __asm__(".globl " #sym) #define __GLOBL(sym) __GLOBL1(sym) +#define __WEAK1(sym) __asm__(".weak " #sym) +#define __WEAK(sym) __WEAK1(sym) + #if defined(__GNUC__) #define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"") #else diff --git a/sys/sys/linker_set.h b/sys/sys/linker_set.h --- a/sys/sys/linker_set.h +++ b/sys/sys/linker_set.h @@ -60,8 +60,8 @@ */ #ifdef __GNUCLIKE___SECTION #define __MAKE_SET_QV(set, sym, qv) \ - __GLOBL(__CONCAT(__start_set_,set)); \ - __GLOBL(__CONCAT(__stop_set_,set)); \ + __WEAK(__CONCAT(__start_set_,set)); \ + __WEAK(__CONCAT(__stop_set_,set)); \ static void const * qv \ __set_##set##_sym_##sym __section("set_" #set) \ __nosanitizeaddress \