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.
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.
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.
17 You should have received a copy of the GNU Lesser General Public
18 License along with the GNU C Library; if not, see
19 <http://www.gnu.org/licenses/>. */
21 #ifndef _LIBC_SYMBOLS_H
22 #define _LIBC_SYMBOLS_H 1
24 /* This is defined for the compilation of all C library code. features.h
25 tests this to avoid inclusion of stubs.h while compiling the library,
26 before stubs.h has been generated. Some library code that is shared
27 with other packages also tests this symbol to see if it is being
28 compiled as part of the C library. We must define this before including
29 config.h, because it makes some definitions conditional on whether libc
30 itself is being compiled, or just some generator program. */
34 /* This file's macros are included implicitly in the compilation of every
35 file in the C library by -imacros.
37 We include uClibc_arch_features.h which is defined by arch devs.
38 It should define for us the following symbols:
40 * HAVE_ASM_SET_DIRECTIVE if we have `.set B, A' instead of `A = B'.
41 * ASM_GLOBAL_DIRECTIVE with `.globl' or `.global'.
42 * ASM_TYPE_DIRECTIVE_PREFIX with `@' or `#' or whatever for .type,
43 or leave it undefined if there is no .type directive.
44 * HAVE_ELF if using ELF, which supports weak symbols using `.weak'.
45 * HAVE_ASM_WEAK_DIRECTIVE if we have weak symbols using `.weak'.
46 * HAVE_ASM_WEAKEXT_DIRECTIVE if we have weak symbols using `.weakext'.
50 #include <bits/uClibc_arch_features.h>
52 /* Enable declarations of GNU extensions, since we are compiling them. */
55 /* Prepare for the case that `__builtin_expect' is not available. */
56 #if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ < 96
57 # define __builtin_expect(x, expected_value) (x)
60 # define likely(x) __builtin_expect((!!(x)),1)
63 # define unlikely(x) __builtin_expect((!!(x)),0)
65 #if defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
67 # define __cold __attribute__ ((__cold__))
70 # define __hot __attribute__ ((__hot__))
80 #ifndef __LINUX_COMPILER_H
81 # define __LINUX_COMPILER_H
84 # define __cast__(_to)
87 #if defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
88 # define attribute_optimize(x) __attribute__ ((optimize(x)))
90 # define attribute_optimize(x)
93 #define attribute_unused __attribute__ ((unused))
95 #if defined __GNUC__ || defined __ICC
96 # define attribute_noreturn __attribute__ ((__noreturn__))
98 # define attribute_noreturn
101 #define libc_freeres_ptr(decl) \
102 __make_section_unallocated ("__libc_freeres_ptrs, \"aw\", %nobits") \
103 decl __attribute__ ((section ("__libc_freeres_ptrs" __sec_comment)))
104 #define __libc_freeres_fn_section \
105 __attribute__ ((section ("__libc_freeres_fn")))
108 # define IS_IN_libc 1
111 /* Indirect stringification. Doing two levels allows
112 * the parameter to be a macro itself.
114 #define __stringify_1(x) #x
115 #define __stringify(x) __stringify_1(x)
117 #ifdef __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
118 # define HAVE_ASM_SET_DIRECTIVE
120 # undef HAVE_ASM_SET_DIRECTIVE
123 #ifdef __UCLIBC_ASM_GLOBAL_DIRECTIVE__
124 # define ASM_GLOBAL_DIRECTIVE __UCLIBC_ASM_GLOBAL_DIRECTIVE__
126 # define ASM_GLOBAL_DIRECTIVE .global
129 #ifdef __UCLIBC_HAVE_ASM_WEAK_DIRECTIVE__
130 # define HAVE_ASM_WEAK_DIRECTIVE
132 # undef HAVE_ASM_WEAK_DIRECTIVE
135 #ifdef __UCLIBC_HAVE_ASM_WEAKEXT_DIRECTIVE__
136 # define HAVE_ASM_WEAKEXT_DIRECTIVE
138 # undef HAVE_ASM_WEAKEXT_DIRECTIVE
141 #ifdef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
142 # define HAVE_ASM_GLOBAL_DOT_NAME
144 # undef HAVE_ASM_GLOBAL_DOT_NAME
147 #ifdef __UCLIBC_HAVE_ASM_CFI_DIRECTIVES__
148 # define HAVE_ASM_CFI_DIRECTIVES
150 # undef HAVE_ASM_CFI_DIRECTIVES
153 #if defined HAVE_ASM_WEAK_DIRECTIVE || defined HAVE_ASM_WEAKEXT_DIRECTIVE
154 # define HAVE_WEAK_SYMBOLS
158 #ifndef C_SYMBOL_NAME
159 # ifndef __UCLIBC_UNDERSCORES__
160 # define C_SYMBOL_NAME(name) name
162 # define C_SYMBOL_NAME(name) _##name
166 #ifdef __UCLIBC_ASM_LINE_SEP__
167 # define ASM_LINE_SEP __UCLIBC_ASM_LINE_SEP__
169 # define ASM_LINE_SEP ;
172 #ifdef HAVE_ASM_GLOBAL_DOT_NAME
173 # ifndef C_SYMBOL_DOT_NAME
174 # if defined __GNUC__ && defined __GNUC_MINOR__ \
175 && (__GNUC__ << 16) + __GNUC_MINOR__ >= (3 << 16) + 1
176 # define C_SYMBOL_DOT_NAME(name) .name
178 # define C_SYMBOL_DOT_NAME(name) .##name
183 #ifndef __ASSEMBLER__
184 /* GCC understands weak symbols and aliases; use its interface where
185 possible, instead of embedded assembly language. */
187 /* Define ALIASNAME as a strong alias for NAME. */
188 # define strong_alias(name, aliasname) _strong_alias(name, aliasname)
189 # define _strong_alias(name, aliasname) \
190 extern __typeof (name) aliasname __attribute__ ((alias (#name)));
191 /* Same, but does not check for type match. Use sparingly.
192 Example: strong_alias(stat,stat64) may fail, this one works: */
193 # define strong_alias_untyped(name, aliasname) \
194 _strong_alias_untyped(name, aliasname)
195 # define _strong_alias_untyped(name, aliasname) \
196 extern __typeof (aliasname) aliasname __attribute__ ((alias (#name)));
198 # ifdef HAVE_WEAK_SYMBOLS
200 /* This comes between the return type and function name in
201 a function definition to make that definition weak. */
202 # define weak_function __attribute__ ((weak))
203 # define weak_const_function __attribute__ ((weak, __const__))
205 /* Define ALIASNAME as a weak alias for NAME.
206 If weak aliases are not available, this defines a strong alias. */
207 # define weak_alias(name, aliasname) _weak_alias (name, aliasname)
208 # define _weak_alias(name, aliasname) \
209 extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
211 /* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */
212 # define weak_extern(symbol) _weak_extern (weak symbol)
213 # define _weak_extern(expr) _Pragma (#expr)
217 # define weak_function /* empty */
218 # define weak_const_function __attribute__ ((__const__))
220 # define weak_alias(name, aliasname) strong_alias(name, aliasname)
221 # define weak_extern(symbol) /* Nothing. */
225 #else /* __ASSEMBLER__ */
227 # ifdef HAVE_ASM_SET_DIRECTIVE
228 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
229 # define strong_alias(original, alias) \
230 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias) ASM_LINE_SEP \
231 .set C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original) ASM_LINE_SEP \
232 ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME(alias) ASM_LINE_SEP \
233 .set C_SYMBOL_DOT_NAME(alias),C_SYMBOL_DOT_NAME(original)
234 # define strong_data_alias(original, alias) \
235 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias) ASM_LINE_SEP \
236 .set C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original)
238 # define strong_alias(original, alias) \
239 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias) ASM_LINE_SEP \
240 .set C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original)
241 # define strong_data_alias(original, alias) strong_alias(original, alias)
244 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
245 # define strong_alias(original, alias) \
246 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias) ASM_LINE_SEP \
247 C_SYMBOL_NAME(alias) = C_SYMBOL_NAME(original) ASM_LINE_SEP \
248 ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME(alias) ASM_LINE_SEP \
249 C_SYMBOL_DOT_NAME(alias) = C_SYMBOL_DOT_NAME(original)
250 # define strong_data_alias(original, alias) \
251 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias) ASM_LINE_SEP \
252 C_SYMBOL_NAME(alias) = C_SYMBOL_NAME(original)
254 # define strong_alias(original, alias) \
255 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias) ASM_LINE_SEP \
256 C_SYMBOL_NAME(alias) = C_SYMBOL_NAME(original)
257 # define strong_data_alias(original, alias) strong_alias(original, alias)
261 # ifdef HAVE_WEAK_SYMBOLS
262 # ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
263 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
264 # define weak_alias(original, alias) \
265 .weakext C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original) ASM_LINE_SEP \
266 .weakext C_SYMBOL_DOT_NAME(alias),C_SYMBOL_DOT_NAME(original)
268 # define weak_alias(original, alias) \
269 .weakext C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original)
271 # define weak_extern(symbol) \
272 .weakext C_SYMBOL_NAME(symbol)
274 # else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
276 # ifdef HAVE_ASM_SET_DIRECTIVE
277 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
278 # define weak_alias(original, alias) \
279 .weak C_SYMBOL_NAME(alias) ASM_LINE_SEP \
280 .set C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original) ASM_LINE_SEP \
281 .weak C_SYMBOL_DOT_NAME(alias) ASM_LINE_SEP \
282 .set C_SYMBOL_DOT_NAME(alias),C_SYMBOL_DOT_NAME(original)
284 # define weak_alias(original, alias) \
285 .weak C_SYMBOL_NAME(alias) ASM_LINE_SEP \
286 .set C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original)
288 # else /* ! HAVE_ASM_SET_DIRECTIVE */
289 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
290 # define weak_alias(original, alias) \
291 .weak C_SYMBOL_NAME(alias) ASM_LINE_SEP \
292 C_SYMBOL_NAME(alias) = C_SYMBOL_NAME(original) ASM_LINE_SEP \
293 .weak C_SYMBOL_DOT_NAME(alias) ASM_LINE_SEP \
294 C_SYMBOL_DOT_NAME(alias) = C_SYMBOL_DOT_NAME(original)
296 # define weak_alias(original, alias) \
297 .weak C_SYMBOL_NAME(alias) ASM_LINE_SEP \
298 C_SYMBOL_NAME(alias) = C_SYMBOL_NAME(original)
301 # define weak_extern(symbol) \
302 .weak C_SYMBOL_NAME(symbol)
304 # endif /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
306 # else /* ! HAVE_WEAK_SYMBOLS */
308 # define weak_alias(original, alias) strong_alias(original, alias)
309 # define weak_extern(symbol) /* Nothing */
310 # endif /* ! HAVE_WEAK_SYMBOLS */
312 #endif /* __ASSEMBLER__ */
315 /* On some platforms we can make internal function calls (i.e., calls of
316 functions not exported) a bit faster by using a different calling
318 #ifndef internal_function
319 # define internal_function /* empty */
323 /* We want the .gnu.warning.SYMBOL section to be unallocated. */
324 #define __make_section_unallocated(section_string) \
325 __asm__ (".section " section_string "\n\t.previous");
328 /* Tacking on "\n#APP\n\t#" to the section name makes gcc put it's bogus
329 section attributes on what looks like a comment to the assembler. */
330 #ifdef __sparc__ /* HAVE_SECTION_QUOTES */
331 # define __sec_comment "\"\n#APP\n\t#\""
333 # define __sec_comment "\n#APP\n\t#"
337 /* When a reference to SYMBOL is encountered, the linker will emit a
338 warning message MSG. */
339 #define link_warning(symbol, msg) \
340 __make_section_unallocated (".gnu.warning." #symbol) \
341 static const char __evoke_link_warning_##symbol[] \
342 __attribute__ ((used, section (".gnu.warning." #symbol __sec_comment))) \
345 /* Handling on non-exported internal names. We have to do this only
348 # define INTUSE(name) name##_internal
349 # define INTDEF(name) strong_alias (name, name##_internal)
350 # define INTVARDEF(name) _INTVARDEF (name, name##_internal)
351 # if defined HAVE_VISIBILITY_ATTRIBUTE
352 # define _INTVARDEF(name, aliasname) \
353 extern __typeof (name) aliasname __attribute__ ((alias (#name), \
354 visibility ("hidden")));
356 # define _INTVARDEF(name, aliasname) \
357 extern __typeof (name) aliasname __attribute__ ((alias (#name)));
359 # define INTDEF2(name, newname) strong_alias (name, newname##_internal)
360 # define INTVARDEF2(name, newname) _INTVARDEF (name, newname##_internal)
362 # define INTUSE(name) name
363 # define INTDEF(name)
364 # define INTVARDEF(name)
365 # define INTDEF2(name, newname)
366 # define INTVARDEF2(name, newname)
370 /* The following macros are used for PLT bypassing within libc.so
371 (and if needed other libraries similarly).
373 If calls to foo within libc.so should always go to foo defined in libc.so,
374 then in include/foo.h you add:
377 libc_hidden_proto(foo)
379 line and after the foo function definition:
391 libc_hidden_weak(foo)
393 Similarly for global data: if references to foo within libc.so
394 should always go to foo defined in libc.so, then in include/foo.h:
397 libc_hidden_proto(foo)
399 and after foo's definition:
401 int foo = INITIAL_FOO_VALUE;
402 libc_hidden_data_def(foo)
406 int foo = INITIAL_FOO_VALUE;
407 libc_hidden_data_weak(foo)
409 If foo is normally just an alias (strong or weak) to some other function,
410 you should use the normal strong_alias first, then add libc_hidden_def
416 strong_alias(baz, foo)
417 libc_hidden_weak(foo)
419 If the function should be internal to multiple objects, say ld.so and
420 libc.so, the best way is to use:
422 #if !defined NOT_IN_libc || defined IS_IN_rtld
426 in include/foo.h and the normal macros at all function definitions
427 depending on what DSO they belong to.
429 If versioned_symbol macro is used to define foo,
430 libc_hidden_ver macro should be used, as in:
432 int __real_foo(int __bar) {
435 versioned_symbol(libc, __real_foo, foo, GLIBC_2_1);
436 libc_hidden_ver(__real_foo, foo)
439 /* uClibc specific (the above comment was copied from glibc):
441 * when ppc64 will be supported, we need changes to support
442 * strong_data_alias (used by asm hidden_data_def)
444 * no versioning support, hidden[_data]_ver are noop
446 * hidden_def() in asm is _hidden_strong_alias (not strong_alias)
448 * libc_hidden_proto(foo) should be added after declaration
449 * in the header, or after extern foo... in all source files
450 * (this is discouraged).
451 * libc_hidden_def does not hide __GI_foo itself, although the name
452 * suggests it (hiding is done exclusively by libc_hidden_proto).
455 * The reasoning to have it after the header w/ foo's prototype is
456 * to get first the __REDIRECT from original header and then create
459 * Hunt for references which still go through PLT (example for x86):
460 * build shared lib, then disassemble it and search for <xxx@plt>:
461 * $ objdump -drx libuClibc-*.so >disasm.txt
462 * $ grep -F '@plt>:' disasm.txt
464 * In uclibc, malloc/free and related functions should be called
465 * through PLT (making it possible to use alternative malloc),
466 * and possibly some __pthread_xxx functions can be called through PLT
467 * (why?). The rest should not use PLT.
470 #if (defined __GNUC__ && defined __GNUC_MINOR__ \
471 && (( __GNUC__ >= 3 && __GNUC_MINOR__ >= 3) || __GNUC__ >= 4) \
473 # define attribute_hidden __attribute__ ((visibility ("hidden")))
474 # define attribute_protected __attribute__ ((visibility ("protected")))
475 # define __hidden_proto_hiddenattr(attrs...) __attribute__ ((visibility ("hidden"), ##attrs))
477 # define attribute_hidden
478 # define attribute_protected
479 # define __hidden_proto_hiddenattr(attrs...)
482 #if /*!defined STATIC &&*/ !defined __BCC__
484 # ifndef __ASSEMBLER__
485 # define hidden_proto(name, attrs...) __hidden_proto(name, __GI_##name, ##attrs)
486 # define __hidden_proto(name, internal, attrs...) \
487 extern __typeof (name) name __asm__ (__hidden_asmname (#internal)) \
488 __hidden_proto_hiddenattr (attrs);
489 # define __hidden_asmname(name) __hidden_asmname1 (__USER_LABEL_PREFIX__, name)
490 # define __hidden_asmname1(prefix, name) __hidden_asmname2(prefix, name)
491 # define __hidden_asmname2(prefix, name) #prefix name
492 # define __hidden_ver1(local, internal, name) \
493 extern __typeof (name) __EI_##name __asm__(__hidden_asmname (#internal)); \
494 extern __typeof (name) __EI_##name __attribute__((alias (__hidden_asmname1 (,#local))))
495 # define hidden_ver(local, name) __hidden_ver1(local, __GI_##name, name);
496 # define hidden_data_ver(local, name) hidden_ver(local, name)
497 # define hidden_def(name) __hidden_ver1(__GI_##name, name, name);
498 # define hidden_data_def(name) hidden_def(name)
499 # define hidden_weak(name) \
500 __hidden_ver1(__GI_##name, name, name) __attribute__((weak));
501 # define hidden_data_weak(name) hidden_weak(name)
503 # else /* __ASSEMBLER__ */
505 # ifdef HAVE_ASM_SET_DIRECTIVE
506 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
507 # define _hidden_strong_alias(original, alias) \
508 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias) ASM_LINE_SEP \
509 .hidden C_SYMBOL_NAME(alias) ASM_LINE_SEP \
510 .set C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original) ASM_LINE_SEP \
511 ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME(alias) ASM_LINE_SEP \
512 .hidden C_SYMBOL_DOT_NAME(alias) ASM_LINE_SEP \
513 .set C_SYMBOL_DOT_NAME(alias),C_SYMBOL_DOT_NAME(original)
515 # define _hidden_strong_alias(original, alias) \
516 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias) ASM_LINE_SEP \
517 .hidden C_SYMBOL_NAME(alias) ASM_LINE_SEP \
518 .set C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original)
520 # else /* dont have .set directive */
521 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
522 # define _hidden_strong_alias(original, alias) \
523 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias) ASM_LINE_SEP \
524 .hidden C_SYMBOL_NAME(alias) ASM_LINE_SEP \
525 C_SYMBOL_NAME(alias) = C_SYMBOL_NAME(original) ASM_LINE_SEP \
526 ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME(alias) ASM_LINE_SEP \
527 .hidden C_SYMBOL_DOT_NAME(alias) ASM_LINE_SEP \
528 C_SYMBOL_DOT_NAME(alias) = C_SYMBOL_DOT_NAME(original)
530 # define _hidden_strong_alias(original, alias) \
531 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias) ASM_LINE_SEP \
532 .hidden C_SYMBOL_NAME(alias) ASM_LINE_SEP \
533 C_SYMBOL_NAME(alias) = C_SYMBOL_NAME(original)
537 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
538 # define _hidden_weak_alias(original, alias) \
539 .hidden C_SYMBOL_NAME(alias) ASM_LINE_SEP \
540 .hidden C_SYMBOL_DOT_NAME(alias) ASM_LINE_SEP \
541 weak_alias(original, alias)
543 # define _hidden_weak_alias(original, alias) \
544 .hidden C_SYMBOL_NAME(alias) ASM_LINE_SEP \
545 weak_alias(original, alias)
548 /* For assembly, we need to do the opposite of what we do in C:
549 in assembly gcc __REDIRECT stuff is not in place, so functions
550 are defined by its normal name and we need to create the
551 __GI_* alias to it, in C __REDIRECT causes the function definition
552 to use __GI_* name and we need to add alias to the real name.
553 There is no reason to use hidden_weak over hidden_def in assembly,
554 but we provide it for consistency with the C usage.
555 hidden_proto doesn't make sense for assembly but the equivalent
556 is to call via the HIDDEN_JUMPTARGET macro instead of JUMPTARGET. */
557 # define hidden_def(name) _hidden_strong_alias (name, __GI_##name)
558 # define hidden_weak(name) _hidden_weak_alias (name, __GI_##name)
559 # define hidden_ver(local, name) strong_alias (local, __GI_##name)
560 # define hidden_data_def(name) _hidden_strong_alias (name, __GI_##name)
561 # define hidden_data_weak(name) _hidden_weak_alias (name, __GI_##name)
562 # define hidden_data_ver(local, name) strong_data_alias (local, __GI_##name)
563 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
564 # define HIDDEN_JUMPTARGET(name) .__GI_##name
566 # define HIDDEN_JUMPTARGET(name) __GI_##name
568 # endif /* __ASSEMBLER__ */
570 #else /* not SHARED */
572 # ifndef __ASSEMBLER__
573 # define hidden_proto(name, attrs...)
575 # define HIDDEN_JUMPTARGET(name) name
576 # endif /* not __ASSEMBLER__ */
577 # define hidden_weak(name)
578 # define hidden_def(name)
579 # define hidden_ver(local, name)
580 # define hidden_data_weak(name)
581 # define hidden_data_def(name)
582 # define hidden_data_ver(local, name)
584 #endif /* SHARED / not SHARED */
587 /* uClibc does not support versioning yet. */
588 #define versioned_symbol(lib, local, symbol, version) /* weak_alias(local, symbol) */
590 #define hidden_ver(local, name) /* strong_alias(local, __GI_##name) */
591 #undef hidden_data_ver
592 #define hidden_data_ver(local, name) /* strong_alias(local,__GI_##name) */
594 #if !defined NOT_IN_libc
595 # define libc_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
596 # define libc_hidden_def(name) hidden_def (name)
597 # define libc_hidden_weak(name) hidden_weak (name)
598 # define libc_hidden_ver(local, name) hidden_ver (local, name)
599 # define libc_hidden_data_def(name) hidden_data_def (name)
600 # define libc_hidden_data_weak(name) hidden_data_weak (name)
601 # define libc_hidden_data_ver(local, name) hidden_data_ver (local, name)
603 # define libc_hidden_proto(name, attrs...)
604 # define libc_hidden_def(name)
605 # define libc_hidden_weak(name)
606 # define libc_hidden_ver(local, name)
607 # define libc_hidden_data_def(name)
608 # define libc_hidden_data_weak(name)
609 # define libc_hidden_data_ver(local, name)
612 #if defined NOT_IN_libc && defined IS_IN_rtld
613 # define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
614 # define rtld_hidden_def(name) hidden_def (name)
615 # define rtld_hidden_weak(name) hidden_weak (name)
616 # define rtld_hidden_ver(local, name) hidden_ver (local, name)
617 # define rtld_hidden_data_def(name) hidden_data_def (name)
618 # define rtld_hidden_data_weak(name) hidden_data_weak (name)
619 # define rtld_hidden_data_ver(local, name) hidden_data_ver (local, name)
621 # define rtld_hidden_proto(name, attrs...)
622 # define rtld_hidden_def(name)
623 # define rtld_hidden_weak(name)
624 # define rtld_hidden_ver(local, name)
625 # define rtld_hidden_data_def(name)
626 # define rtld_hidden_data_weak(name)
627 # define rtld_hidden_data_ver(local, name)
630 #if defined NOT_IN_libc && defined IS_IN_libm
631 # define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
632 # define libm_hidden_def(name) hidden_def (name)
633 # define libm_hidden_weak(name) hidden_weak (name)
634 # define libm_hidden_ver(local, name) hidden_ver (local, name)
635 # define libm_hidden_data_def(name) hidden_data_def (name)
636 # define libm_hidden_data_weak(name) hidden_data_weak (name)
637 # define libm_hidden_data_ver(local, name) hidden_data_ver (local, name)
639 # define libm_hidden_proto(name, attrs...)
640 # define libm_hidden_def(name)
641 # define libm_hidden_weak(name)
642 # define libm_hidden_ver(local, name)
643 # define libm_hidden_data_def(name)
644 # define libm_hidden_data_weak(name)
645 # define libm_hidden_data_ver(local, name)
648 #if defined NOT_IN_libc && defined IS_IN_libresolv
649 # define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
650 # define libresolv_hidden_def(name) hidden_def (name)
651 # define libresolv_hidden_weak(name) hidden_weak (name)
652 # define libresolv_hidden_ver(local, name) hidden_ver (local, name)
653 # define libresolv_hidden_data_def(name) hidden_data_def (name)
654 # define libresolv_hidden_data_weak(name) hidden_data_weak (name)
655 # define libresolv_hidden_data_ver(local, name) hidden_data_ver (local, name)
657 # define libresolv_hidden_proto(name, attrs...)
658 # define libresolv_hidden_def(name)
659 # define libresolv_hidden_weak(name)
660 # define libresolv_hidden_ver(local, name)
661 # define libresolv_hidden_data_def(name)
662 # define libresolv_hidden_data_weak(name)
663 # define libresolv_hidden_data_ver(local, name)
666 #if defined NOT_IN_libc && defined IS_IN_librt
667 # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
668 # define librt_hidden_def(name) hidden_def (name)
669 # define librt_hidden_weak(name) hidden_weak (name)
670 # define librt_hidden_ver(local, name) hidden_ver (local, name)
671 # define librt_hidden_data_def(name) hidden_data_def (name)
672 # define librt_hidden_data_weak(name) hidden_data_weak (name)
673 # define librt_hidden_data_ver(local, name) hidden_data_ver (local, name)
675 # define librt_hidden_proto(name, attrs...)
676 # define librt_hidden_def(name)
677 # define librt_hidden_weak(name)
678 # define librt_hidden_ver(local, name)
679 # define librt_hidden_data_def(name)
680 # define librt_hidden_data_weak(name)
681 # define librt_hidden_data_ver(local, name)
684 #if defined NOT_IN_libc && defined IS_IN_libdl
685 # define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
686 # define libdl_hidden_def(name) hidden_def (name)
687 # define libdl_hidden_weak(name) hidden_weak (name)
688 # define libdl_hidden_ver(local, name) hidden_ver (local, name)
689 # define libdl_hidden_data_def(name) hidden_data_def (name)
690 # define libdl_hidden_data_weak(name) hidden_data_weak (name)
691 # define libdl_hidden_data_ver(local, name) hidden_data_ver (local, name)
693 # define libdl_hidden_proto(name, attrs...)
694 # define libdl_hidden_def(name)
695 # define libdl_hidden_weak(name)
696 # define libdl_hidden_ver(local, name)
697 # define libdl_hidden_data_def(name)
698 # define libdl_hidden_data_weak(name)
699 # define libdl_hidden_data_ver(local, name)
702 #if defined NOT_IN_libc && defined IS_IN_libintl
703 # define libintl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
704 # define libintl_hidden_def(name) hidden_def (name)
705 # define libintl_hidden_weak(name) hidden_weak (name)
706 # define libintl_hidden_ver(local, name) hidden_ver (local, name)
707 # define libintl_hidden_data_def(name) hidden_data_def (name)
708 # define libintl_hidden_data_weak(name) hidden_data_weak (name)
709 # define libintl_hidden_data_ver(local, name) hidden_data_ver(local, name)
711 # define libintl_hidden_proto(name, attrs...)
712 # define libintl_hidden_def(name)
713 # define libintl_hidden_weak(name)
714 # define libintl_hidden_ver(local, name)
715 # define libintl_hidden_data_def(name)
716 # define libintl_hidden_data_weak(name)
717 # define libintl_hidden_data_ver(local, name)
720 #if defined NOT_IN_libc && defined IS_IN_libnsl
721 # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
722 # define libnsl_hidden_def(name) hidden_def (name)
723 # define libnsl_hidden_weak(name) hidden_weak (name)
724 # define libnsl_hidden_ver(local, name) hidden_ver (local, name)
725 # define libnsl_hidden_data_def(name) hidden_data_def (name)
726 # define libnsl_hidden_data_weak(name) hidden_data_weak (name)
727 # define libnsl_hidden_data_ver(local, name) hidden_data_ver (local, name)
729 # define libnsl_hidden_proto(name, attrs...)
730 # define libnsl_hidden_def(name)
731 # define libnsl_hidden_weak(name)
732 # define libnsl_hidden_ver(local, name)
733 # define libnsl_hidden_data_def(name)
734 # define libnsl_hidden_data_weak(name)
735 # define libnsl_hidden_data_ver(local, name)
738 #if defined NOT_IN_libc && defined IS_IN_libutil
739 # define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
740 # define libutil_hidden_def(name) hidden_def (name)
741 # define libutil_hidden_weak(name) hidden_weak (name)
742 # define libutil_hidden_ver(local, name) hidden_ver (local, name)
743 # define libutil_hidden_data_def(name) hidden_data_def (name)
744 # define libutil_hidden_data_weak(name) hidden_data_weak (name)
745 # define libutil_hidden_data_ver(local, name) hidden_data_ver (local, name)
747 # define libutil_hidden_proto(name, attrs...)
748 # define libutil_hidden_def(name)
749 # define libutil_hidden_weak(name)
750 # define libutil_hidden_ver(local, name)
751 # define libutil_hidden_data_def(name)
752 # define libutil_hidden_data_weak(name)
753 # define libutil_hidden_data_ver(local, name)
756 #if defined NOT_IN_libc && defined IS_IN_libcrypt
757 # define libcrypt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
758 # define libcrypt_hidden_def(name) hidden_def (name)
759 # define libcrypt_hidden_weak(name) hidden_weak (name)
760 # define libcrypt_hidden_ver(local, name) hidden_ver (local, name)
761 # define libcrypt_hidden_data_def(name) hidden_data_def (name)
762 # define libcrypt_hidden_data_weak(name) hidden_data_weak (name)
763 # define libcrypt_hidden_data_ver(local, name) hidden_data_ver (local, name)
765 # define libcrypt_hidden_proto(name, attrs...)
766 # define libcrypt_hidden_def(name)
767 # define libcrypt_hidden_weak(name)
768 # define libcrypt_hidden_ver(local, name)
769 # define libcrypt_hidden_data_def(name)
770 # define libcrypt_hidden_data_weak(name)
771 # define libcrypt_hidden_data_ver(local, name)
774 #if defined NOT_IN_libc && defined IS_IN_libpthread
775 # define libpthread_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
776 # define libpthread_hidden_def(name) hidden_def (name)
777 # define libpthread_hidden_weak(name) hidden_weak (name)
778 # define libpthread_hidden_ver(local, name) hidden_ver (local, name)
779 # define libpthread_hidden_data_def(name) hidden_data_def (name)
780 # define libpthread_hidden_data_weak(name) hidden_data_weak (name)
781 # define libpthread_hidden_data_ver(local, name) hidden_data_ver (local, name)
783 # define libpthread_hidden_proto(name, attrs...)
784 # define libpthread_hidden_def(name)
785 # define libpthread_hidden_weak(name)
786 # define libpthread_hidden_ver(local, name)
787 # define libpthread_hidden_data_def(name)
788 # define libpthread_hidden_data_weak(name)
789 # define libpthread_hidden_data_ver(local, name)
792 #endif /* libc-symbols.h */