The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/sys/cdefs_elf.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      $NetBSD: cdefs_elf.h,v 1.30 2008/07/21 15:22:19 lukem Exp $     */
    2 
    3 /*
    4  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
    5  * All rights reserved.
    6  *
    7  * Author: Chris G. Demetriou
    8  *
    9  * Permission to use, copy, modify and distribute this software and
   10  * its documentation is hereby granted, provided that both the copyright
   11  * notice and this permission notice appear in all copies of the
   12  * software, derivative works or modified versions, and any portions
   13  * thereof, and that both notices appear in supporting documentation.
   14  *
   15  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
   16  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
   17  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
   18  *
   19  * Carnegie Mellon requests users of this software to return to
   20  *
   21  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
   22  *  School of Computer Science
   23  *  Carnegie Mellon University
   24  *  Pittsburgh PA 15213-3890
   25  *
   26  * any improvements or extensions that they make and grant Carnegie the
   27  * rights to redistribute these changes.
   28  */
   29 
   30 #ifndef _SYS_CDEFS_ELF_H_
   31 #define _SYS_CDEFS_ELF_H_
   32 
   33 #ifdef __LEADING_UNDERSCORE
   34 #define _C_LABEL(x)     __CONCAT(_,x)
   35 #define _C_LABEL_STRING(x)      "_"x
   36 #else
   37 #define _C_LABEL(x)     x
   38 #define _C_LABEL_STRING(x)      x
   39 #endif
   40 
   41 #if __STDC__
   42 #define ___RENAME(x)    __asm(___STRING(_C_LABEL(x)))
   43 #else
   44 #ifdef __LEADING_UNDERSCORE
   45 #define ___RENAME(x)    ____RENAME(_/**/x)
   46 #define ____RENAME(x)   __asm(___STRING(x))
   47 #else
   48 #define ___RENAME(x)    __asm(___STRING(x))
   49 #endif
   50 #endif
   51 
   52 #define __indr_reference(sym,alias)     /* nada, since we do weak refs */
   53 
   54 #if __STDC__
   55 #define __strong_alias(alias,sym)                                       \
   56     __asm(".global " _C_LABEL_STRING(#alias) "\n"                       \
   57             _C_LABEL_STRING(#alias) " = " _C_LABEL_STRING(#sym));
   58 
   59 #define __weak_alias(alias,sym)                                         \
   60     __asm(".weak " _C_LABEL_STRING(#alias) "\n"                 \
   61             _C_LABEL_STRING(#alias) " = " _C_LABEL_STRING(#sym));
   62 
   63 /* Do not use __weak_extern, use __weak_reference instead */
   64 #define __weak_extern(sym)                                              \
   65     __asm(".weak " _C_LABEL_STRING(#sym));
   66 
   67 #if __GNUC_PREREQ__(4, 0)
   68 #define __weak_reference(sym)   __attribute__((__weakref__))
   69 #else
   70 #define __weak_reference(sym)   ; __asm(".weak " _C_LABEL_STRING(#sym))
   71 #endif
   72 
   73 #define __warn_references(sym,msg)                                      \
   74     __asm(".pushsection .gnu.warning." #sym "\n"                        \
   75           ".ascii \"" msg "\"\n"                                        \
   76           ".popsection");
   77 
   78 #else /* !__STDC__ */
   79 
   80 #ifdef __LEADING_UNDERSCORE
   81 #define __weak_alias(alias,sym) ___weak_alias(_/**/alias,_/**/sym)
   82 #define ___weak_alias(alias,sym)                                        \
   83     __asm(".weak alias\nalias = sym");
   84 #else
   85 #define __weak_alias(alias,sym)                                         \
   86     __asm(".weak alias\nalias = sym");
   87 #endif
   88 #ifdef __LEADING_UNDERSCORE
   89 #define __weak_extern(sym) ___weak_extern(_/**/sym)
   90 #define ___weak_extern(sym)                                             \
   91     __asm(".weak sym");
   92 #else
   93 #define __weak_extern(sym)                                              \
   94     __asm(".weak sym");
   95 #endif
   96 #define __warn_references(sym,msg)                                      \
   97     __asm(".pushsection .gnu.warning.sym\n"                             \
   98           ".ascii \"" msg "\"\n"                                        \
   99           ".popsection");
  100 
  101 #endif /* !__STDC__ */
  102 
  103 #if __STDC__
  104 #define __SECTIONSTRING(_sec, _str)                                     \
  105         __asm(".pushsection " #_sec "\n"                                \
  106               ".asciz \"" _str "\"\n"                                   \
  107               ".popsection")
  108 #else
  109 #define __SECTIONSTRING(_sec, _str)                                     \
  110         __asm(".pushsection _sec\n"                                     \
  111               ".asciz \"" _str "\"\n"                                   \
  112               ".popsection")
  113 #endif
  114 
  115 #define __IDSTRING(_n,_s)               __SECTIONSTRING(.ident,_s)
  116 
  117 #define __RCSID(_s)                     __IDSTRING(rcsid,_s)
  118 #define __SCCSID(_s)
  119 #define __SCCSID2(_s)
  120 #define __COPYRIGHT(_s)                 __SECTIONSTRING(.copyright,_s)
  121 
  122 #define __KERNEL_RCSID(_n, _s)          __RCSID(_s)
  123 #define __KERNEL_SCCSID(_n, _s)
  124 #define __KERNEL_COPYRIGHT(_n, _s)      __COPYRIGHT(_s)
  125 
  126 #ifndef __lint__
  127 #define __link_set_make_entry(set, sym)                                 \
  128         static void const * const __link_set_##set##_sym_##sym          \
  129             __section("link_set_" #set) __used = &sym
  130 #define __link_set_make_entry2(set, sym, n)                             \
  131         static void const * const __link_set_##set##_sym_##sym##_##n    \
  132             __section("link_set_" #set) __used = &sym[n]
  133 #else
  134 #define __link_set_make_entry(set, sym)                                 \
  135         extern void const * const __link_set_##set##_sym_##sym
  136 #define __link_set_make_entry2(set, sym, n)                             \
  137         extern void const * const __link_set_##set##_sym_##sym##_##n
  138 #endif /* __lint__ */
  139 
  140 #define __link_set_add_text(set, sym)   __link_set_make_entry(set, sym)
  141 #define __link_set_add_rodata(set, sym) __link_set_make_entry(set, sym)
  142 #define __link_set_add_data(set, sym)   __link_set_make_entry(set, sym)
  143 #define __link_set_add_bss(set, sym)    __link_set_make_entry(set, sym)
  144 #define __link_set_add_text2(set, sym, n)   __link_set_make_entry2(set, sym, n)
  145 #define __link_set_add_rodata2(set, sym, n) __link_set_make_entry2(set, sym, n)
  146 #define __link_set_add_data2(set, sym, n)   __link_set_make_entry2(set, sym, n)
  147 #define __link_set_add_bss2(set, sym, n)    __link_set_make_entry2(set, sym, n)
  148 
  149 #define __link_set_decl(set, ptype)                                     \
  150         extern ptype * const __start_link_set_##set[];                  \
  151         extern ptype * const __stop_link_set_##set[]                    \
  152 
  153 #define __link_set_start(set)   (__start_link_set_##set)
  154 #define __link_set_end(set)     (__stop_link_set_##set)
  155 
  156 #define __link_set_count(set)                                           \
  157         (__link_set_end(set) - __link_set_start(set))
  158 
  159 #endif /* !_SYS_CDEFS_ELF_H_ */

Cache object: 2e72b9d646acf4bab123e488d1429c6b


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.