svn commit: r215318 - in head/sys: net sys

Dimitry Andric dim at FreeBSD.org
Sun Nov 14 20:40:56 UTC 2010


Author: dim
Date: Sun Nov 14 20:40:55 2010
New Revision: 215318
URL: http://svn.freebsd.org/changeset/base/215318

Log:
  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.

Modified:
  head/sys/net/vnet.h
  head/sys/sys/cdefs.h
  head/sys/sys/linker_set.h
  head/sys/sys/pcpu.h

Modified: head/sys/net/vnet.h
==============================================================================
--- head/sys/net/vnet.h	Sun Nov 14 20:38:11 2010	(r215317)
+++ head/sys/net/vnet.h	Sun Nov 14 20:40:55 2010	(r215318)
@@ -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)							\

Modified: head/sys/sys/cdefs.h
==============================================================================
--- head/sys/sys/cdefs.h	Sun Nov 14 20:38:11 2010	(r215317)
+++ head/sys/sys/cdefs.h	Sun Nov 14 20:40:55 2010	(r215318)
@@ -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 "\"")

Modified: head/sys/sys/linker_set.h
==============================================================================
--- head/sys/sys/linker_set.h	Sun Nov 14 20:38:11 2010	(r215317)
+++ head/sys/sys/linker_set.h	Sun Nov 14 20:40:55 2010	(r215318)
@@ -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 */

Modified: head/sys/sys/pcpu.h
==============================================================================
--- head/sys/sys/pcpu.h	Sun Nov 14 20:38:11 2010	(r215317)
+++ head/sys/sys/pcpu.h	Sun Nov 14 20:40:55 2010	(r215318)
@@ -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)
 


More information about the svn-src-all mailing list