From 566af50bd26d7739d1e62d23438b32aef21383eb Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 11 Nov 2010 19:17:59 +0000 Subject: [PATCH] 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 --- sys/sys/cdefs.h | 3 +++ sys/sys/linker_set.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index bcb4367f30c1..958c74d5ff6a 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -401,6 +401,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 diff --git a/sys/sys/linker_set.h b/sys/sys/linker_set.h index 5f55beb5a3b7..2edb55b24f8f 100644 --- a/sys/sys/linker_set.h +++ b/sys/sys/linker_set.h @@ -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 */