OSDN Git Service

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