source: trunk/libs/newlib/src/libgloss/libnosys/warning.h @ 546

Last change on this file since 546 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 1.3 KB
Line 
1#ifndef __WARNING_H__
2#define __WARNING_H__
3
4#ifdef HAVE_GNU_LD
5# ifdef HAVE_ELF
6
7/* We want the .gnu.warning.SYMBOL section to be unallocated.  */
8#  ifdef HAVE_ASM_PREVIOUS_DIRECTIVE
9#   define __make_section_unallocated(section_string)   \
10  asm(".section " section_string "\n .previous");
11#  elif defined (HAVE_ASM_POPSECTION_DIRECTIVE)
12#   define __make_section_unallocated(section_string)   \
13  asm(".pushsection " section_string "\n .popsection");
14#  else
15#   define __make_section_unallocated(section_string)
16#  endif
17
18#  ifdef HAVE_SECTION_ATTRIBUTES
19#   define link_warning(symbol, msg)                     \
20  static const char __evoke_link_warning_##symbol[]     \
21    __attribute__ ((section (".gnu.warning." __SYMBOL_PREFIX #symbol), \
22                   __used__)) = msg;
23#  else
24#   define link_warning(symbol, msg)
25#  endif
26
27#else /* !ELF */
28
29#  define link_warning(symbol, msg)             \
30  asm(".stabs \"" msg "\",30,0,0,0\n"   \
31      ".stabs \"" __SYMBOL_PREFIX #symbol "\",1,0,0,0\n");
32# endif
33#else /* !GNULD */
34/* We will never be heard; they will all die horribly.  */
35# define link_warning(symbol, msg)
36#endif
37
38/* A canned warning for sysdeps/stub functions.
39   The GNU linker prepends a "warning: " string.  */
40#define stub_warning(name) \
41  link_warning (name, \
42                #name " is not implemented and will always fail")
43
44#endif /* __WARNING_H__ */
Note: See TracBrowser for help on using the repository browser.