From owner-svn-src-stable-8@FreeBSD.ORG Mon May 6 19:59:15 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 24FE2DB0; Mon, 6 May 2013 19:59:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 17A52FD5; Mon, 6 May 2013 19:59:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46JxEPk041113; Mon, 6 May 2013 19:59:14 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46JxEUA041105; Mon, 6 May 2013 19:59:14 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201305061959.r46JxEUA041105@svn.freebsd.org> From: Dimitry Andric Date: Mon, 6 May 2013 19:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250306 - in stable/8/sys: net sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 19:59:15 -0000 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 #include +#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