Author: dim
Date: Mon May  6 19:59:13 2013
New Revision: 250306
URL: http://svnweb.freebsd.org/changeset/base/250306

Log:
  MFC r215137:
  
    Revert r103230, which depended on ld preserving the __start_xxx and
    __stop_xxx symbols for custom sections, even when these were not
    referenced (at link time).  This behaviour was changed again in binutils
    commit 0b8ed435c3fe8bd09a08c23920e65bfb03251221.
  
    This time, put the __GLOBL macro definition in cdefs.h, so it can be
    reused in a few other places where it will be needed.
  
    Reviewed by:        kib
  
  MFC r215138:
  
    Use the same treatment as in linker_set.h for the __start and __stop
    symbols of the set_vnet and set_pcpu sections, so those symbols will
    always be emitted in kernel modules, if they use vnet.h or pcpu.h.
  
    Also, for pcpu.h, make the __(start|stop)_set_pcpu declarations, and
    associated macros invisible to userland, to prevent it picking up these
    symbols.
  
    Reviewed by:        kib

Modified:
  stable/8/sys/net/vnet.h
  stable/8/sys/sys/cdefs.h
  stable/8/sys/sys/linker_set.h
  stable/8/sys/sys/pcpu.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/net/   (props changed)
  stable/8/sys/sys/   (props changed)

Modified: stable/8/sys/net/vnet.h
==============================================================================
--- stable/8/sys/net/vnet.h     Mon May  6 19:50:22 2013        (r250305)
+++ stable/8/sys/net/vnet.h     Mon May  6 19:59:13 2013        (r250306)
@@ -95,7 +95,9 @@ 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

Modified: stable/8/sys/sys/cdefs.h
==============================================================================
--- stable/8/sys/sys/cdefs.h    Mon May  6 19:50:22 2013        (r250305)
+++ stable/8/sys/sys/cdefs.h    Mon May  6 19:59:13 2013        (r250306)
@@ -396,6 +396,9 @@
 #endif /* __STDC__ */
 #endif /* __GNUC__ || __INTEL_COMPILER */
 
+#define        __GLOBL1(sym)   __asm__(".globl " #sym)
+#define        __GLOBL(sym)    __GLOBL1(sym)
+
 #if defined(__GNUC__) || defined(__INTEL_COMPILER)
 #define        __IDSTRING(name,string) __asm__(".ident\t\"" string "\"")
 #else

Modified: stable/8/sys/sys/linker_set.h
==============================================================================
--- stable/8/sys/sys/linker_set.h       Mon May  6 19:50:22 2013        
(r250305)
+++ stable/8/sys/sys/linker_set.h       Mon May  6 19:59:13 2013        
(r250306)
@@ -45,6 +45,8 @@
  */
 #ifdef __GNUCLIKE___SECTION
 #define __MAKE_SET(set, sym)                                           \
+       __GLOBL(__CONCAT(__start_set_,set));                            \
+       __GLOBL(__CONCAT(__stop_set_,set));                             \
        static void const * const __set_##set##_sym_##sym               \
        __section("set_" #set) __used = &sym
 #else /* !__GNUCLIKE___SECTION */

Modified: stable/8/sys/sys/pcpu.h
==============================================================================
--- stable/8/sys/sys/pcpu.h     Mon May  6 19:50:22 2013        (r250305)
+++ stable/8/sys/sys/pcpu.h     Mon May  6 19:59:13 2013        (r250306)
@@ -42,11 +42,15 @@
 #include <sys/resource.h>
 #include <machine/pcpu.h>
 
+#ifdef _KERNEL
+
 /*
  * 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.
@@ -127,6 +131,8 @@ extern uintptr_t dpcpu_off[];
        }                                                               \
 } while(0)
 
+#endif /* _KERNEL */
+
 /* 
  * XXXUPS remove as soon as we have per cpu variable
  * linker sets and can define rm_queue in _rm_lock.h
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to