Index: lib/libkvm/kvm.c =================================================================== --- lib/libkvm/kvm.c +++ lib/libkvm/kvm.c @@ -64,7 +64,7 @@ #include "kvm_private.h" -SET_DECLARE(kvm_arch, struct kvm_arch); +SET_DECLARE_WEAK(kvm_arch, struct kvm_arch); static char _kd_is_null[] = ""; Index: sys/dev/uart/uart_cpu_fdt.h =================================================================== --- sys/dev/uart/uart_cpu_fdt.h +++ sys/dev/uart/uart_cpu_fdt.h @@ -46,7 +46,7 @@ * If your UART driver implements uart_class and custom device layer, * then use UART_FDT_CLASS for its declaration */ -SET_DECLARE(uart_fdt_class_set, struct ofw_compat_data ); +SET_DECLARE_WEAK(uart_fdt_class_set, struct ofw_compat_data ); #define UART_FDT_CLASS(data) \ DATA_SET(uart_fdt_class_set, data) Index: sys/sys/linker_set.h =================================================================== --- sys/sys/linker_set.h +++ sys/sys/linker_set.h @@ -84,7 +84,12 @@ /* * Initialize before referring to a given linker set. */ -#define SET_DECLARE(set, ptype) \ +#define SET_DECLARE(set, ptype) \ + extern ptype *__CONCAT(__start_set_,set); \ + extern ptype *__CONCAT(__stop_set_,set) + +/* Like SET_DECLARE() but also marks the symbols weak to support empty sets. */ +#define SET_DECLARE_WEAK(set, ptype) \ extern ptype __weak_symbol *__CONCAT(__start_set_,set); \ extern ptype __weak_symbol *__CONCAT(__stop_set_,set)