1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

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.
This commit is contained in:
Dimitry Andric 2010-11-14 20:40:55 +00:00
parent 31c6a0037e
commit c3adda9fc3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=215318
4 changed files with 11 additions and 10 deletions

View File

@ -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) \

View File

@ -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 "\"")

View File

@ -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 */

View File

@ -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)