aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/linker_set.h
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2002-09-23 06:11:29 +0000
committerPeter Wemm <peter@FreeBSD.org>2002-09-23 06:11:29 +0000
commita7865fc147339b0285eff983c74d344e6fc9c294 (patch)
treef435ca08a2637edc0d7163be9df09b4b3f9e46f9 /sys/sys/linker_set.h
parentacb460624eda45fa9f342c3f63370e18b1532b5e (diff)
downloadsrc-a7865fc147339b0285eff983c74d344e6fc9c294.tar.gz
src-a7865fc147339b0285eff983c74d344e6fc9c294.zip
Add a __section(x) macro as well. Use this in linker_set.h. ie:
static void const * const __set_##set##_sym_##sym __attribute__((__section__("set_" #set),__unused__)) = &sym becomes: static void const * const __set_##set##_sym_##sym __section("set_" #set) __unused = &sym Like the other macros, these #define away for unrecognized compilers or lint. Also, fix the argments in the previous commit for the non-gcc case. lint might be a bit happier about that. Note that the gcc <= 2.6 case needs some research.
Notes
Notes: svn path=/head/; revision=103836
Diffstat (limited to 'sys/sys/linker_set.h')
-rw-r--r--sys/sys/linker_set.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sys/linker_set.h b/sys/sys/linker_set.h
index ee60ffd4b1e2..f025e18db14d 100644
--- a/sys/sys/linker_set.h
+++ b/sys/sys/linker_set.h
@@ -42,7 +42,7 @@
#ifdef __GNUC__
#define __MAKE_SET(set, sym) \
static void const * const __set_##set##_sym_##sym \
- __attribute__((__section__("set_" #set),__unused__)) = &sym
+ __section("set_" #set) __unused = &sym
#else /* !__GNUC__ */
#ifndef lint
#error "This file needs to be compiled by GCC or lint"