fixed more binutils issues (newer gcc/libc)
[zpugcc/jano.git] / toolchain / gcc / libgloss / libnosys / warning.h
blob2c2998250c2a37b6b74cd6842f38c1f4d4b33f61
1 #ifndef __WARNING_H__
2 #define __WARNING_H__
4 #ifdef HAVE_GNU_LD
5 # ifdef HAVE_ELF
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 "; .previous");
11 # elif defined (HAVE_ASM_POPSECTION_DIRECTIVE)
12 # define __make_section_unallocated(section_string) \
13 asm(".pushsection " section_string "; .popsection");
14 # else
15 # define __make_section_unallocated(section_string)
16 # endif
18 # ifdef HAVE_SECTION_ATTRIBUTES
19 # define link_warning(symbol, msg) \
20 __make_section_unallocated (".gnu.warning." #symbol) \
21 static const char __evoke_link_warning_##symbol[] \
22 __attribute__ ((section (".gnu.warning." #symbol))) = msg;
23 # else
24 # define link_warning(symbol, msg)
25 # endif
27 #else /* !ELF */
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
38 /* A canned warning for sysdeps/stub functions. */
39 #define stub_warning(name) \
40 link_warning (name, \
41 "warning: " #name " is not implemented and will always fail")
43 #endif /* __WARNING_H__ */