OSDN Git Service

Make sure __hot and __cold are always defined.
[uclinux-h8/uClibc.git] / include / libc-symbols.h
1 /* Support macros for making weak and strong aliases for symbols,
2    and for using symbol sets and linker warnings with GNU ld.
3    Copyright (C) 1995-1998,2000-2003,2004,2005,2006
4         Free Software Foundation, Inc.
5    This file is part of the GNU C Library.
6
7    The GNU C Library is free software; you can redistribute it and/or
8    modify it under the terms of the GNU Lesser General Public
9    License as published by the Free Software Foundation; either
10    version 2.1 of the License, or (at your option) any later version.
11
12    The GNU C Library is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15    Lesser General Public License for more details.
16
17    You should have received a copy of the GNU Lesser General Public
18    License along with the GNU C Library; if not, write to the Free
19    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20    02111-1307 USA.  */
21
22 #ifndef _LIBC_SYMBOLS_H
23 #define _LIBC_SYMBOLS_H 1
24
25 /* This is defined for the compilation of all C library code.  features.h
26    tests this to avoid inclusion of stubs.h while compiling the library,
27    before stubs.h has been generated.  Some library code that is shared
28    with other packages also tests this symbol to see if it is being
29    compiled as part of the C library.  We must define this before including
30    config.h, because it makes some definitions conditional on whether libc
31    itself is being compiled, or just some generator program.  */
32 #define _LIBC   1
33
34
35 /* This file's macros are included implicitly in the compilation of every
36    file in the C library by -imacros.
37
38    We include uClibc_arch_features.h which is defined by arch devs.
39    It should define for us the following symbols:
40
41    * HAVE_ASM_SET_DIRECTIVE if we have `.set B, A' instead of `A = B'.
42    * ASM_GLOBAL_DIRECTIVE with `.globl' or `.global'.
43    * ASM_TYPE_DIRECTIVE_PREFIX with `@' or `#' or whatever for .type,
44      or leave it undefined if there is no .type directive.
45    * HAVE_ELF if using ELF, which supports weak symbols using `.weak'.
46    * HAVE_ASM_WEAK_DIRECTIVE if we have weak symbols using `.weak'.
47    * HAVE_ASM_WEAKEXT_DIRECTIVE if we have weak symbols using `.weakext'.
48
49    */
50
51 #include <bits/uClibc_arch_features.h>
52
53 /* Enable declarations of GNU extensions, since we are compiling them.  */
54 #define _GNU_SOURCE     1
55
56 /* Prepare for the case that `__builtin_expect' is not available.  */
57 #if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ < 96
58 # define __builtin_expect(x, expected_value) (x)
59 #endif
60 #ifndef likely
61 # define likely(x)      __builtin_expect((!!(x)),1)
62 #endif
63 #ifndef unlikely
64 # define unlikely(x)    __builtin_expect((!!(x)),0)
65 #endif
66 #if defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
67 # ifndef __cold
68 #  define __cold __attribute__ ((__cold__))
69 # endif
70 # ifndef __hot
71 #  define __hot __attribute__ ((__hot__))
72 # endif
73 #else
74 # ifndef __cold
75 #  define __cold
76 # endif
77 # ifndef __hot
78 #  define __hot
79 # endif
80 #endif
81 #ifndef __LINUX_COMPILER_H
82 # define __LINUX_COMPILER_H
83 #endif
84 #ifndef __cast__
85 # define __cast__(_to)
86 #endif
87
88 #define attribute_unused __attribute__ ((unused))
89
90 #if defined __GNUC__ || defined __ICC
91 # define attribute_noreturn __attribute__ ((__noreturn__))
92 #else
93 # define attribute_noreturn
94 #endif
95
96 #ifndef NOT_IN_libc
97 # define IS_IN_libc 1
98 #endif
99
100 /* Indirect stringification.  Doing two levels allows
101  * the parameter to be a macro itself.
102  */
103 #define __stringify_1(x)    #x
104 #define __stringify(x)      __stringify_1(x)
105
106 #ifdef __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
107 # define HAVE_ASM_SET_DIRECTIVE
108 #else
109 # undef HAVE_ASM_SET_DIRECTIVE
110 #endif
111
112 #ifdef __UCLIBC_ASM_GLOBAL_DIRECTIVE__
113 # define ASM_GLOBAL_DIRECTIVE __UCLIBC_ASM_GLOBAL_DIRECTIVE__
114 #else
115 # define ASM_GLOBAL_DIRECTIVE .global
116 #endif
117
118 #ifdef __UCLIBC_HAVE_ASM_WEAK_DIRECTIVE__
119 # define HAVE_ASM_WEAK_DIRECTIVE
120 #else
121 # undef HAVE_ASM_WEAK_DIRECTIVE
122 #endif
123
124 #ifdef __UCLIBC_HAVE_ASM_WEAKEXT_DIRECTIVE__
125 # define HAVE_ASM_WEAKEXT_DIRECTIVE
126 #else
127 # undef HAVE_ASM_WEAKEXT_DIRECTIVE
128 #endif
129
130 #ifdef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
131 # define HAVE_ASM_GLOBAL_DOT_NAME
132 #else
133 # undef HAVE_ASM_GLOBAL_DOT_NAME
134 #endif
135
136 #if defined HAVE_ASM_WEAK_DIRECTIVE || defined HAVE_ASM_WEAKEXT_DIRECTIVE
137 # define HAVE_WEAK_SYMBOLS
138 #endif
139
140 #undef C_SYMBOL_NAME
141 #ifndef C_SYMBOL_NAME
142 # ifndef __UCLIBC_UNDERSCORES__
143 #  define C_SYMBOL_NAME(name) name
144 # else
145 #  define C_SYMBOL_NAME(name) _##name
146 # endif
147 #endif
148
149 #ifdef __UCLIBC_ASM_LINE_SEP__
150 # define ASM_LINE_SEP __UCLIBC_ASM_LINE_SEP__
151 #else
152 # define ASM_LINE_SEP ;
153 #endif
154
155 #ifdef HAVE_ASM_GLOBAL_DOT_NAME
156 # ifndef C_SYMBOL_DOT_NAME
157 #  if defined __GNUC__ && defined __GNUC_MINOR__ \
158       && (__GNUC__ << 16) + __GNUC_MINOR__ >= (3 << 16) + 1
159 #   define C_SYMBOL_DOT_NAME(name) .name
160 #  else
161 #   define C_SYMBOL_DOT_NAME(name) .##name
162 #  endif
163 # endif
164 #endif
165
166 #ifndef __ASSEMBLER__
167 /* GCC understands weak symbols and aliases; use its interface where
168    possible, instead of embedded assembly language.  */
169
170 /* Define ALIASNAME as a strong alias for NAME.  */
171 # define strong_alias(name, aliasname) _strong_alias(name, aliasname)
172 # define _strong_alias(name, aliasname) \
173   extern __typeof (name) aliasname __attribute__ ((alias (#name)));
174
175 /* This comes between the return type and function name in
176    a function definition to make that definition weak.  */
177 # define weak_function __attribute__ ((weak))
178 # define weak_const_function __attribute__ ((weak, __const__))
179
180 # ifdef HAVE_WEAK_SYMBOLS
181
182 /* Define ALIASNAME as a weak alias for NAME.
183    If weak aliases are not available, this defines a strong alias.  */
184 #  define weak_alias(name, aliasname) _weak_alias (name, aliasname)
185 #  define _weak_alias(name, aliasname) \
186   extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
187
188 /* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined).  */
189 #  define weak_extern(symbol) _weak_extern (weak symbol)
190 #  define _weak_extern(expr) _Pragma (#expr)
191
192 # else
193
194 #  define weak_alias(name, aliasname) strong_alias(name, aliasname)
195 #  define weak_extern(symbol) /* Nothing. */
196
197 # endif
198
199 #else /* __ASSEMBLER__ */
200
201 # ifdef HAVE_ASM_SET_DIRECTIVE
202 #  ifdef HAVE_ASM_GLOBAL_DOT_NAME
203 #   define strong_alias(original, alias)                                \
204   ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP               \
205   .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original) ASM_LINE_SEP      \
206   ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP           \
207   .set C_SYMBOL_DOT_NAME (alias),C_SYMBOL_DOT_NAME (original)
208 #   define strong_data_alias(original, alias)                           \
209   ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP               \
210   .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original)
211 #  else
212 #   define strong_alias(original, alias)                                \
213   ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP               \
214   .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original)
215 #   define strong_data_alias(original, alias) strong_alias(original, alias)
216 #  endif
217 # else
218 #  ifdef HAVE_ASM_GLOBAL_DOT_NAME
219 #   define strong_alias(original, alias)                                \
220   ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP               \
221   C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP         \
222   ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP           \
223   C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
224 #   define strong_data_alias(original, alias)                           \
225   ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP               \
226   C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
227 #  else
228 #   define strong_alias(original, alias)                                \
229   ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP               \
230   C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
231 #   define strong_data_alias(original, alias) strong_alias(original, alias)
232 #  endif
233 # endif
234
235 # ifdef HAVE_WEAK_SYMBOLS
236 #  ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
237 #   ifdef HAVE_ASM_GLOBAL_DOT_NAME
238 #    define weak_alias(original, alias)                                 \
239   .weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original) ASM_LINE_SEP \
240   .weakext C_SYMBOL_DOT_NAME (alias), C_SYMBOL_DOT_NAME (original)
241 #   else
242 #    define weak_alias(original, alias)                                 \
243   .weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original)
244 #   endif
245 #   define weak_extern(symbol)                                          \
246   .weakext C_SYMBOL_NAME (symbol)
247
248 #  else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
249
250 #   ifdef HAVE_ASM_SET_DIRECTIVE
251 #    ifdef HAVE_ASM_GLOBAL_DOT_NAME
252 #     define weak_alias(original, alias)                                \
253   .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP                              \
254   .set C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original) ASM_LINE_SEP     \
255   .weak C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP                          \
256   .set C_SYMBOL_DOT_NAME (alias), C_SYMBOL_DOT_NAME (original)
257 #    else
258 #     define weak_alias(original, alias)                                \
259   .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP                              \
260   .set C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original)
261 #    endif
262 #   else /* ! HAVE_ASM_SET_DIRECTIVE */
263 #    ifdef HAVE_ASM_GLOBAL_DOT_NAME
264 #     define weak_alias(original, alias)                                \
265   .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP                              \
266   C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP         \
267   .weak C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP                          \
268   C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
269 #    else
270 #     define weak_alias(original, alias)                                \
271   .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP                              \
272   C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
273 #    endif
274 #   endif
275 #   define weak_extern(symbol)                                          \
276   .weak C_SYMBOL_NAME (symbol)
277
278 #  endif /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
279
280 # else /* ! HAVE_WEAK_SYMBOLS */
281
282 #  define weak_alias(original, alias) strong_alias(original, alias)
283 #  define weak_extern(symbol) /* Nothing */
284 # endif /* ! HAVE_WEAK_SYMBOLS */
285
286 #endif /* __ASSEMBLER__ */
287
288 /* On some platforms we can make internal function calls (i.e., calls of
289    functions not exported) a bit faster by using a different calling
290    convention.  */
291 #ifndef internal_function
292 # define internal_function      /* empty */
293 #endif
294
295 /* We want the .gnu.warning.SYMBOL section to be unallocated.  */
296 #define __make_section_unallocated(section_string)      \
297   __asm__ (".section " section_string "\n\t.previous");
298
299 /* Tacking on "\n#APP\n\t#" to the section name makes gcc put it's bogus
300    section attributes on what looks like a comment to the assembler.  */
301 #ifdef __sparc__ /* HAVE_SECTION_QUOTES */
302 # define __sec_comment "\"\n#APP\n\t#\""
303 #else
304 # define __sec_comment "\n#APP\n\t#"
305 #endif
306
307 /* When a reference to SYMBOL is encountered, the linker will emit a
308    warning message MSG.  */
309 #define link_warning(symbol, msg) \
310   __make_section_unallocated (".gnu.warning." #symbol) \
311   static const char __evoke_link_warning_##symbol[]     \
312     __attribute__ ((used, section (".gnu.warning." #symbol __sec_comment))) \
313     = msg;
314
315 /* Handling on non-exported internal names.  We have to do this only
316    for shared code.  */
317 #ifdef SHARED
318 # define INTUSE(name) name##_internal
319 # define INTDEF(name) strong_alias (name, name##_internal)
320 # define INTVARDEF(name) \
321   _INTVARDEF (name, name##_internal)
322 # if defined HAVE_VISIBILITY_ATTRIBUTE
323 #  define _INTVARDEF(name, aliasname) \
324   extern __typeof (name) aliasname __attribute__ ((alias (#name), \
325                                                    visibility ("hidden")));
326 # else
327 #  define _INTVARDEF(name, aliasname) \
328   extern __typeof (name) aliasname __attribute__ ((alias (#name)));
329 # endif
330 # define INTDEF2(name, newname) strong_alias (name, newname##_internal)
331 # define INTVARDEF2(name, newname) _INTVARDEF (name, newname##_internal)
332 #else
333 # define INTUSE(name) name
334 # define INTDEF(name)
335 # define INTVARDEF(name)
336 # define INTDEF2(name, newname)
337 # define INTVARDEF2(name, newname)
338 #endif
339
340 /* The following macros are used for PLT bypassing within libc.so
341    (and if needed other libraries similarly).
342    First of all, you need to have the function prototyped somewhere,
343    say in foo/foo.h:
344
345    int foo (int __bar);
346
347    If calls to foo within libc.so should always go to foo defined in libc.so,
348    then in include/foo.h you add:
349
350    libc_hidden_proto (foo)
351
352    line and after the foo function definition:
353
354    int foo (int __bar)
355    {
356      return __bar;
357    }
358    libc_hidden_def (foo)
359
360    or
361
362    int foo (int __bar)
363    {
364      return __bar;
365    }
366    libc_hidden_weak (foo)
367
368    Similarly for global data.  If references to foo within libc.so should
369    always go to foo defined in libc.so, then in include/foo.h you add:
370
371    libc_hidden_proto (foo)
372
373    line and after foo's definition:
374
375    int foo = INITIAL_FOO_VALUE;
376    libc_hidden_data_def (foo)
377
378    or
379
380    int foo = INITIAL_FOO_VALUE;
381    libc_hidden_data_weak (foo)
382
383    If foo is normally just an alias (strong or weak) to some other function,
384    you should use the normal strong_alias first, then add libc_hidden_def
385    or libc_hidden_weak:
386
387    int baz (int __bar)
388    {
389      return __bar;
390    }
391    strong_alias (baz, foo)
392    libc_hidden_weak (foo)
393
394    If the function should be internal to multiple objects, say ld.so and
395    libc.so, the best way is to use:
396
397    #if !defined NOT_IN_libc || defined IS_IN_rtld
398    hidden_proto (foo)
399    #endif
400
401    in include/foo.h and the normal macros at all function definitions
402    depending on what DSO they belong to.
403
404    If versioned_symbol macro is used to define foo,
405    libc_hidden_ver macro should be used, as in:
406
407    int __real_foo (int __bar)
408    {
409      return __bar;
410    }
411    versioned_symbol (libc, __real_foo, foo, GLIBC_2_1);
412    libc_hidden_ver (__real_foo, foo)  */
413
414 /* uClibc specific (the above comment was copied from glibc):
415  * a. when ppc64 will be supported, we need changes to support:
416  * strong_data_alias (used by asm hidden_data_def)
417  * b. libc_hidden_proto(foo) should be added after the header having foo's prototype
418  * or after extern foo... to all source files that should use the internal version
419  * of foo within libc, even to the file defining foo itself, libc_hidden_def does
420  * not hide __GI_foo itself, although the name suggests it (hiding is done exclusively
421  * by libc_hidden_proto). The reasoning to have it after the header w/ foo's prototype is
422  * to get first the __REDIRECT from original header and then create the __GI_foo alias
423  * c. no versioning support, hidden[_data]_ver are noop
424  * d. hidden_def() in asm is _hidden_strong_alias (not strong_alias) */
425
426 /* Arrange to hide uClibc internals */
427 #if (defined __GNUC__ && \
428   (defined __GNUC_MINOR__ && ( __GNUC__ >= 3 && __GNUC_MINOR__ >= 3 ) \
429    || __GNUC__ >= 4)) || defined __ICC
430 # define attribute_hidden __attribute__ ((visibility ("hidden")))
431 # define __hidden_proto_hiddenattr(attrs...) __attribute__ ((visibility ("hidden"), ##attrs))
432 #else
433 # define attribute_hidden
434 # define __hidden_proto_hiddenattr(attrs...)
435 #endif
436
437 #if /*!defined STATIC &&*/ !defined __BCC__
438 # ifndef __ASSEMBLER__
439 #  define hidden_proto(name, attrs...) __hidden_proto (name, __GI_##name, ##attrs)
440 #  define __hidden_proto(name, internal, attrs...) \
441    extern __typeof (name) name __asm__ (__hidden_asmname (#internal)) \
442    __hidden_proto_hiddenattr (attrs);
443 #  define __hidden_asmname(name) __hidden_asmname1 (__USER_LABEL_PREFIX__, name)
444 #  define __hidden_asmname1(prefix, name) __hidden_asmname2(prefix, name)
445 #  define __hidden_asmname2(prefix, name) #prefix name
446 #  define __hidden_ver1(local, internal, name) \
447    extern __typeof (name) __EI_##name __asm__(__hidden_asmname (#internal)); \
448    extern __typeof (name) __EI_##name __attribute__((alias (__hidden_asmname1 (,#local))))
449 #  define hidden_ver(local, name)       __hidden_ver1(local, __GI_##name, name);
450 #  define hidden_data_ver(local, name)  hidden_ver(local, name)
451 #  define hidden_def(name)              __hidden_ver1(__GI_##name, name, name);
452 #  define hidden_data_def(name)         hidden_def(name)
453 #  define hidden_weak(name)     \
454         __hidden_ver1(__GI_##name, name, name) __attribute__((weak));
455 #  define hidden_data_weak(name)        hidden_weak(name)
456
457 # else /* __ASSEMBLER__ */
458 # ifdef HAVE_ASM_SET_DIRECTIVE
459 #  ifdef HAVE_ASM_GLOBAL_DOT_NAME
460 #   define _hidden_strong_alias(original, alias)                                \
461   ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP               \
462   .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP                            \
463   .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original) ASM_LINE_SEP      \
464   ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP           \
465   .hidden C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP                        \
466   .set C_SYMBOL_DOT_NAME (alias),C_SYMBOL_DOT_NAME (original)
467 #  else
468 #   define _hidden_strong_alias(original, alias)                                \
469   ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP               \
470   .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP                            \
471   .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original)
472 #  endif
473 # else
474 #  ifdef HAVE_ASM_GLOBAL_DOT_NAME
475 #   define _hidden_strong_alias(original, alias)                                \
476   ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP               \
477   .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP                            \
478   C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP         \
479   ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP           \
480   .hidden C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP                        \
481   C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
482 #  else
483 #   define _hidden_strong_alias(original, alias)                                \
484   ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP               \
485   .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP                            \
486   C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
487 #  endif
488 # endif
489
490 #  ifdef HAVE_ASM_GLOBAL_DOT_NAME
491 #   define _hidden_weak_alias(original, alias)                          \
492      .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP                         \
493      .hidden C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP                     \
494      weak_alias(original, alias)
495 #  else
496 #   define _hidden_weak_alias(original, alias)                          \
497      .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP                         \
498      weak_alias(original, alias)
499 #  endif
500
501 /* For assembly, we need to do the opposite of what we do in C:
502    in assembly gcc __REDIRECT stuff is not in place, so functions
503    are defined by its normal name and we need to create the
504    __GI_* alias to it, in C __REDIRECT causes the function definition
505    to use __GI_* name and we need to add alias to the real name.
506    There is no reason to use hidden_weak over hidden_def in assembly,
507    but we provide it for consistency with the C usage.
508    hidden_proto doesn't make sense for assembly but the equivalent
509    is to call via the HIDDEN_JUMPTARGET macro instead of JUMPTARGET.  */
510 #  define hidden_def(name)      _hidden_strong_alias (name, __GI_##name)
511 #  define hidden_weak(name)     _hidden_weak_alias (name, __GI_##name)
512 #  define hidden_ver(local, name) strong_alias (local, __GI_##name)
513 #  define hidden_data_def(name) _hidden_strong_alias (name, __GI_##name)
514 #  define hidden_data_weak(name)        _hidden_weak_alias (name, __GI_##name)
515 #  define hidden_data_ver(local, name) strong_data_alias (local, __GI_##name)
516 #  ifdef HAVE_ASM_GLOBAL_DOT_NAME
517 #   define HIDDEN_JUMPTARGET(name) .__GI_##name
518 #  else
519 #   define HIDDEN_JUMPTARGET(name) __GI_##name
520 #  endif
521 # endif /* __ASSEMBLER__ */
522 #else /* SHARED */
523 # ifndef __ASSEMBLER__
524 #  define hidden_proto(name, attrs...)
525 # else
526 #  define HIDDEN_JUMPTARGET(name) name
527 # endif /* Not  __ASSEMBLER__ */
528 # define hidden_weak(name)
529 # define hidden_def(name)
530 # define hidden_ver(local, name)
531 # define hidden_data_weak(name)
532 # define hidden_data_def(name)
533 # define hidden_data_ver(local, name)
534 #endif /* SHARED */
535
536 /* uClibc does not support versioning yet. */
537 #define versioned_symbol(lib, local, symbol, version) /* weak_alias(local, symbol) */
538 #undef hidden_ver
539 #define hidden_ver(local, name) /* strong_alias(local, __GI_##name) */
540 #undef hidden_data_ver
541 #define hidden_data_ver(local, name) /* strong_alias(local,__GI_##name) */
542
543 #if !defined NOT_IN_libc
544 # define libc_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
545 # define libc_hidden_def(name) hidden_def (name)
546 # define libc_hidden_weak(name) hidden_weak (name)
547 # define libc_hidden_ver(local, name) hidden_ver (local, name)
548 # define libc_hidden_data_def(name) hidden_data_def (name)
549 # define libc_hidden_data_weak(name) hidden_data_weak (name)
550 # define libc_hidden_data_ver(local, name) hidden_data_ver (local, name)
551 #else
552 # define libc_hidden_proto(name, attrs...)
553 # define libc_hidden_def(name)
554 # define libc_hidden_weak(name)
555 # define libc_hidden_ver(local, name)
556 # define libc_hidden_data_def(name)
557 # define libc_hidden_data_weak(name)
558 # define libc_hidden_data_ver(local, name)
559 #endif
560
561 #if defined NOT_IN_libc && defined IS_IN_rtld
562 # define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
563 # define rtld_hidden_def(name) hidden_def (name)
564 # define rtld_hidden_weak(name) hidden_weak (name)
565 # define rtld_hidden_ver(local, name) hidden_ver (local, name)
566 # define rtld_hidden_data_def(name) hidden_data_def (name)
567 # define rtld_hidden_data_weak(name) hidden_data_weak (name)
568 # define rtld_hidden_data_ver(local, name) hidden_data_ver (local, name)
569 #else
570 # define rtld_hidden_proto(name, attrs...)
571 # define rtld_hidden_def(name)
572 # define rtld_hidden_weak(name)
573 # define rtld_hidden_ver(local, name)
574 # define rtld_hidden_data_def(name)
575 # define rtld_hidden_data_weak(name)
576 # define rtld_hidden_data_ver(local, name)
577 #endif
578
579 #if defined NOT_IN_libc && defined IS_IN_libm
580 # define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
581 # define libm_hidden_def(name) hidden_def (name)
582 # define libm_hidden_weak(name) hidden_weak (name)
583 # define libm_hidden_ver(local, name) hidden_ver (local, name)
584 # define libm_hidden_data_def(name) hidden_data_def (name)
585 # define libm_hidden_data_weak(name) hidden_data_weak (name)
586 # define libm_hidden_data_ver(local, name) hidden_data_ver (local, name)
587 #else
588 # define libm_hidden_proto(name, attrs...)
589 # define libm_hidden_def(name)
590 # define libm_hidden_weak(name)
591 # define libm_hidden_ver(local, name)
592 # define libm_hidden_data_def(name)
593 # define libm_hidden_data_weak(name)
594 # define libm_hidden_data_ver(local, name)
595 #endif
596
597 #if defined NOT_IN_libc && defined IS_IN_libresolv
598 # define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
599 # define libresolv_hidden_def(name) hidden_def (name)
600 # define libresolv_hidden_weak(name) hidden_weak (name)
601 # define libresolv_hidden_ver(local, name) hidden_ver (local, name)
602 # define libresolv_hidden_data_def(name) hidden_data_def (name)
603 # define libresolv_hidden_data_weak(name) hidden_data_weak (name)
604 # define libresolv_hidden_data_ver(local, name) hidden_data_ver (local, name)
605 #else
606 # define libresolv_hidden_proto(name, attrs...)
607 # define libresolv_hidden_def(name)
608 # define libresolv_hidden_weak(name)
609 # define libresolv_hidden_ver(local, name)
610 # define libresolv_hidden_data_def(name)
611 # define libresolv_hidden_data_weak(name)
612 # define libresolv_hidden_data_ver(local, name)
613 #endif
614
615 #if defined NOT_IN_libc && defined IS_IN_librt
616 # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
617 # define librt_hidden_def(name) hidden_def (name)
618 # define librt_hidden_weak(name) hidden_weak (name)
619 # define librt_hidden_ver(local, name) hidden_ver (local, name)
620 # define librt_hidden_data_def(name) hidden_data_def (name)
621 # define librt_hidden_data_weak(name) hidden_data_weak (name)
622 # define librt_hidden_data_ver(local, name) hidden_data_ver (local, name)
623 #else
624 # define librt_hidden_proto(name, attrs...)
625 # define librt_hidden_def(name)
626 # define librt_hidden_weak(name)
627 # define librt_hidden_ver(local, name)
628 # define librt_hidden_data_def(name)
629 # define librt_hidden_data_weak(name)
630 # define librt_hidden_data_ver(local, name)
631 #endif
632
633 #if defined NOT_IN_libc && defined IS_IN_libdl
634 # define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
635 # define libdl_hidden_def(name) hidden_def (name)
636 # define libdl_hidden_weak(name) hidden_weak (name)
637 # define libdl_hidden_ver(local, name) hidden_ver (local, name)
638 # define libdl_hidden_data_def(name) hidden_data_def (name)
639 # define libdl_hidden_data_weak(name) hidden_data_weak (name)
640 # define libdl_hidden_data_ver(local, name) hidden_data_ver (local, name)
641 #else
642 # define libdl_hidden_proto(name, attrs...)
643 # define libdl_hidden_def(name)
644 # define libdl_hidden_weak(name)
645 # define libdl_hidden_ver(local, name)
646 # define libdl_hidden_data_def(name)
647 # define libdl_hidden_data_weak(name)
648 # define libdl_hidden_data_ver(local, name)
649 #endif
650
651 #if defined NOT_IN_libc && defined IS_IN_libintl
652 # define libintl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
653 # define libintl_hidden_def(name) hidden_def (name)
654 # define libintl_hidden_weak(name) hidden_weak (name)
655 # define libintl_hidden_ver(local, name) hidden_ver (local, name)
656 # define libintl_hidden_data_def(name) hidden_data_def (name)
657 # define libintl_hidden_data_weak(name) hidden_data_weak (name)
658 # define libintl_hidden_data_ver(local, name) hidden_data_ver(local, name)
659 #else
660 # define libintl_hidden_proto(name, attrs...)
661 # define libintl_hidden_def(name)
662 # define libintl_hidden_weak(name)
663 # define libintl_hidden_ver(local, name)
664 # define libintl_hidden_data_def(name)
665 # define libintl_hidden_data_weak(name)
666 # define libintl_hidden_data_ver(local, name)
667 #endif
668
669 #if defined NOT_IN_libc && defined IS_IN_libnsl
670 # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
671 # define libnsl_hidden_def(name) hidden_def (name)
672 # define libnsl_hidden_weak(name) hidden_weak (name)
673 # define libnsl_hidden_ver(local, name) hidden_ver (local, name)
674 # define libnsl_hidden_data_def(name) hidden_data_def (name)
675 # define libnsl_hidden_data_weak(name) hidden_data_weak (name)
676 # define libnsl_hidden_data_ver(local, name) hidden_data_ver (local, name)
677 #else
678 # define libnsl_hidden_proto(name, attrs...)
679 # define libnsl_hidden_def(name)
680 # define libnsl_hidden_weak(name)
681 # define libnsl_hidden_ver(local, name)
682 # define libnsl_hidden_data_def(name)
683 # define libnsl_hidden_data_weak(name)
684 # define libnsl_hidden_data_ver(local, name)
685 #endif
686
687 #if defined NOT_IN_libc && defined IS_IN_libutil
688 # define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
689 # define libutil_hidden_def(name) hidden_def (name)
690 # define libutil_hidden_weak(name) hidden_weak (name)
691 # define libutil_hidden_ver(local, name) hidden_ver (local, name)
692 # define libutil_hidden_data_def(name) hidden_data_def (name)
693 # define libutil_hidden_data_weak(name) hidden_data_weak (name)
694 # define libutil_hidden_data_ver(local, name) hidden_data_ver (local, name)
695 #else
696 # define libutil_hidden_proto(name, attrs...)
697 # define libutil_hidden_def(name)
698 # define libutil_hidden_weak(name)
699 # define libutil_hidden_ver(local, name)
700 # define libutil_hidden_data_def(name)
701 # define libutil_hidden_data_weak(name)
702 # define libutil_hidden_data_ver(local, name)
703 #endif
704
705 #if defined NOT_IN_libc && defined IS_IN_libcrypt
706 # define libcrypt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
707 # define libcrypt_hidden_def(name) hidden_def (name)
708 # define libcrypt_hidden_weak(name) hidden_weak (name)
709 # define libcrypt_hidden_ver(local, name) hidden_ver (local, name)
710 # define libcrypt_hidden_data_def(name) hidden_data_def (name)
711 # define libcrypt_hidden_data_weak(name) hidden_data_weak (name)
712 # define libcrypt_hidden_data_ver(local, name) hidden_data_ver (local, name)
713 #else
714 # define libcrypt_hidden_proto(name, attrs...)
715 # define libcrypt_hidden_def(name)
716 # define libcrypt_hidden_weak(name)
717 # define libcrypt_hidden_ver(local, name)
718 # define libcrypt_hidden_data_def(name)
719 # define libcrypt_hidden_data_weak(name)
720 # define libcrypt_hidden_data_ver(local, name)
721 #endif
722
723 #if defined NOT_IN_libc && defined IS_IN_libpthread
724 # define libpthread_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
725 # define libpthread_hidden_def(name) hidden_def (name)
726 # define libpthread_hidden_weak(name) hidden_weak (name)
727 # define libpthread_hidden_ver(local, name) hidden_ver (local, name)
728 # define libpthread_hidden_data_def(name) hidden_data_def (name)
729 # define libpthread_hidden_data_weak(name) hidden_data_weak (name)
730 # define libpthread_hidden_data_ver(local, name) hidden_data_ver (local, name)
731 #else
732 # define libpthread_hidden_proto(name, attrs...)
733 # define libpthread_hidden_def(name)
734 # define libpthread_hidden_weak(name)
735 # define libpthread_hidden_ver(local, name)
736 # define libpthread_hidden_data_def(name)
737 # define libpthread_hidden_data_weak(name)
738 # define libpthread_hidden_data_ver(local, name)
739 #endif
740
741 #endif /* libc-symbols.h */