summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2010-11-14 20:40:55 +0000
committerdim <dim@FreeBSD.org>2010-11-14 20:40:55 +0000
commit02778a6df67bca2283e2b9d79262fe0692dab2d4 (patch)
tree76a6c820ce8838f6029104fb889ee1dbd0ea6d9b /sys
parentfda4020a881f36122bca03f2d8327da8bc67863d (diff)
downloadFreeBSD-src-02778a6df67bca2283e2b9d79262fe0692dab2d4.zip
FreeBSD-src-02778a6df67bca2283e2b9d79262fe0692dab2d4.tar.gz
Instead of unconditionally emitting .globl's for the __start_set_xxx and
__stop_set_xxx symbols, only emit them when the set_vnet or set_pcpu sections are actually defined.
Diffstat (limited to 'sys')
-rw-r--r--sys/net/vnet.h7
-rw-r--r--sys/sys/cdefs.h3
-rw-r--r--sys/sys/linker_set.h4
-rw-r--r--sys/sys/pcpu.h7
4 files changed, 11 insertions, 10 deletions
diff --git a/sys/net/vnet.h b/sys/net/vnet.h
index 1453194..beecd43 100644
--- a/sys/net/vnet.h
+++ b/sys/net/vnet.h
@@ -95,9 +95,7 @@ struct vnet {
* Location of the kernel's 'set_vnet' linker set.
*/
extern uintptr_t *__start_set_vnet;
-__GLOBL(__start_set_vnet);
extern uintptr_t *__stop_set_vnet;
-__GLOBL(__stop_set_vnet);
#define VNET_START (uintptr_t)&__start_set_vnet
#define VNET_STOP (uintptr_t)&__stop_set_vnet
@@ -195,7 +193,10 @@ extern struct sx vnet_sxlock;
*/
#define VNET_NAME(n) vnet_entry_##n
#define VNET_DECLARE(t, n) extern t VNET_NAME(n)
-#define VNET_DEFINE(t, n) t VNET_NAME(n) __section(VNET_SETNAME) __used
+#define VNET_DEFINE(t, n) \
+ __GLOBL("__start_" VNET_SETNAME); \
+ __GLOBL("__stop_" VNET_SETNAME); \
+ t VNET_NAME(n) __section(VNET_SETNAME) __used
#define STATIC_VNET_DEFINE(t, n) \
VNET_DEFINE(static t, n)
#define _VNET_PTR(b, n) \
diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
index 958c74d..b5803a0 100644
--- a/sys/sys/cdefs.h
+++ b/sys/sys/cdefs.h
@@ -401,8 +401,7 @@
#endif /* __STDC__ */
#endif /* __GNUC__ || __INTEL_COMPILER */
-#define __GLOBL1(sym) __asm__(".globl " #sym)
-#define __GLOBL(sym) __GLOBL1(sym)
+#define __GLOBL(sym) __asm__(".globl " sym)
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
#define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"")
diff --git a/sys/sys/linker_set.h b/sys/sys/linker_set.h
index 2edb55b..11c6b1d 100644
--- a/sys/sys/linker_set.h
+++ b/sys/sys/linker_set.h
@@ -45,8 +45,8 @@
*/
#ifdef __GNUCLIKE___SECTION
#define __MAKE_SET(set, sym) \
- __GLOBL(__CONCAT(__start_set_,set)); \
- __GLOBL(__CONCAT(__stop_set_,set)); \
+ __GLOBL("__start_set_" #set); \
+ __GLOBL("__stop_set_" #set); \
static void const * const __set_##set##_sym_##sym \
__section("set_" #set) __used = &sym
#else /* !__GNUCLIKE___SECTION */
diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h
index d18a150..81fd783 100644
--- a/sys/sys/pcpu.h
+++ b/sys/sys/pcpu.h
@@ -51,9 +51,7 @@
* Define a set for pcpu data.
*/
extern uintptr_t *__start_set_pcpu;
-__GLOBL(__start_set_pcpu);
extern uintptr_t *__stop_set_pcpu;
-__GLOBL(__stop_set_pcpu);
/*
* Array of dynamic pcpu base offsets. Indexed by id.
@@ -75,7 +73,10 @@ extern uintptr_t dpcpu_off[];
*/
#define DPCPU_NAME(n) pcpu_entry_##n
#define DPCPU_DECLARE(t, n) extern t DPCPU_NAME(n)
-#define DPCPU_DEFINE(t, n) t DPCPU_NAME(n) __section(DPCPU_SETNAME) __used
+#define DPCPU_DEFINE(t, n) \
+ __GLOBL("__start_" DPCPU_SETNAME); \
+ __GLOBL("__stop_" DPCPU_SETNAME); \
+ t DPCPU_NAME(n) __section(DPCPU_SETNAME) __used
#define STATIC_DPCPU_DEFINE(t, n) \
DPCPU_DEFINE(static t, n)
OpenPOWER on IntegriCloud