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 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 #ifndef _LIBC_SYMBOLS_H
22 #define _LIBC_SYMBOLS_H 1
24 /* This file's macros are included implicitly in the compilation of every
25 file in the C library by -imacros.
27 We include config.h which is generated by configure.
28 It should define for us the following symbols:
30 * HAVE_ASM_SET_DIRECTIVE if we have `.set B, A' instead of `A = B'.
31 * ASM_GLOBAL_DIRECTIVE with `.globl' or `.global'.
32 * ASM_TYPE_DIRECTIVE_PREFIX with `@' or `#' or whatever for .type,
33 or leave it undefined if there is no .type directive.
34 * HAVE_GNU_LD if using GNU ld, with support for weak symbols in a.out,
35 and for symbol set and warning messages extensions in a.out and ELF.
36 * HAVE_ELF if using ELF, which supports weak symbols using `.weak'.
37 * HAVE_ASM_WEAK_DIRECTIVE if we have weak symbols using `.weak'.
38 * HAVE_ASM_WEAKEXT_DIRECTIVE if we have weak symbols using `.weakext'.
42 /* This is defined for the compilation of all C library code. features.h
43 tests this to avoid inclusion of stubs.h while compiling the library,
44 before stubs.h has been generated. Some library code that is shared
45 with other packages also tests this symbol to see if it is being
46 compiled as part of the C library. We must define this before including
47 config.h, because it makes some definitions conditional on whether libc
48 itself is being compiled, or just some generator program. */
51 /* Enable declarations of GNU extensions, since we are compiling them. */
53 /* And we also need the data for the reentrant functions. */
58 /* The symbols in all the user (non-_) macros are C symbols.
59 HAVE_GNU_LD without HAVE_ELF implies a.out. */
61 #if defined HAVE_ASM_WEAK_DIRECTIVE || defined HAVE_ASM_WEAKEXT_DIRECTIVE
62 # define HAVE_WEAK_SYMBOLS
65 #ifndef __SYMBOL_PREFIX
66 # ifdef NO_UNDERSCORES
67 # define __SYMBOL_PREFIX
69 # define __SYMBOL_PREFIX "_"
74 # ifdef NO_UNDERSCORES
75 # define C_SYMBOL_NAME(name) name
77 # define C_SYMBOL_NAME(name) _##name
82 # define ASM_LINE_SEP ;
85 #ifdef HAVE_ASM_GLOBAL_DOT_NAME
86 # ifndef C_SYMBOL_DOT_NAME
87 # if defined __GNUC__ && defined __GNUC_MINOR__ \
88 && (__GNUC__ << 16) + __GNUC_MINOR__ >= (3 << 16) + 1
89 # define C_SYMBOL_DOT_NAME(name) .name
91 # define C_SYMBOL_DOT_NAME(name) .##name
97 /* GCC understands weak symbols and aliases; use its interface where
98 possible, instead of embedded assembly language. */
100 /* Define ALIASNAME as a strong alias for NAME. */
101 # define strong_alias(name, aliasname) _strong_alias(name, aliasname)
102 # define _strong_alias(name, aliasname) \
103 extern __typeof (name) aliasname __attribute__ ((alias (#name)));
105 /* This comes between the return type and function name in
106 a function definition to make that definition weak. */
107 # define weak_function __attribute__ ((weak))
108 # define weak_const_function __attribute__ ((weak, __const__))
110 # ifdef HAVE_WEAK_SYMBOLS
112 /* Define ALIASNAME as a weak alias for NAME.
113 If weak aliases are not available, this defines a strong alias. */
114 # define weak_alias(name, aliasname) _weak_alias (name, aliasname)
115 # define _weak_alias(name, aliasname) \
116 extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
118 /* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */
119 # define weak_extern(symbol) _weak_extern (weak symbol)
120 # define _weak_extern(expr) _Pragma (#expr)
124 # define weak_alias(name, aliasname) strong_alias(name, aliasname)
125 # define weak_extern(symbol) /* Nothing. */
129 #else /* __ASSEMBLER__ */
131 # ifdef HAVE_ASM_SET_DIRECTIVE
132 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
133 # define strong_alias(original, alias) \
134 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
135 .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original) ASM_LINE_SEP \
136 ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
137 .set C_SYMBOL_DOT_NAME (alias),C_SYMBOL_DOT_NAME (original)
138 # define strong_data_alias(original, alias) \
139 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
140 .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original)
142 # define strong_alias(original, alias) \
143 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
144 .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original)
145 # define strong_data_alias(original, alias) strong_alias(original, alias)
148 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
149 # define strong_alias(original, alias) \
150 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
151 C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP \
152 ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
153 C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
154 # define strong_data_alias(original, alias) \
155 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
156 C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
158 # define strong_alias(original, alias) \
159 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
160 C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
161 # define strong_data_alias(original, alias) strong_alias(original, alias)
165 # ifdef HAVE_WEAK_SYMBOLS
166 # ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
167 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
168 # define weak_alias(original, alias) \
169 .weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original) ASM_LINE_SEP \
170 .weakext C_SYMBOL_DOT_NAME (alias), C_SYMBOL_DOT_NAME (original)
172 # define weak_alias(original, alias) \
173 .weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original)
175 # define weak_extern(symbol) \
176 .weakext C_SYMBOL_NAME (symbol)
178 # else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
180 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
181 # define weak_alias(original, alias) \
182 .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \
183 C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP \
184 .weak C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
185 C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
187 # define weak_alias(original, alias) \
188 .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \
189 C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
192 # define weak_extern(symbol) \
193 .weak C_SYMBOL_NAME (symbol)
195 # endif /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
197 # else /* ! HAVE_WEAK_SYMBOLS */
199 # define weak_alias(original, alias) strong_alias(original, alias)
200 # define weak_extern(symbol) /* Nothing */
201 # endif /* ! HAVE_WEAK_SYMBOLS */
203 #endif /* __ASSEMBLER__ */
205 /* On some platforms we can make internal function calls (i.e., calls of
206 functions not exported) a bit faster by using a different calling
208 #ifndef internal_function
209 # define internal_function /* empty */
212 /* Prepare for the case that `__builtin_expect' is not available. */
213 #ifndef HAVE_BUILTIN_EXPECT
214 # define __builtin_expect(expr, val) (expr)
217 /* Determine the return address. */
218 #define RETURN_ADDRESS(nr) \
219 __builtin_extract_return_addr (__builtin_return_address (nr))
221 /* When a reference to SYMBOL is encountered, the linker will emit a
222 warning message MSG. */
226 /* We want the .gnu.warning.SYMBOL section to be unallocated. */
227 # ifdef HAVE_ASM_PREVIOUS_DIRECTIVE
228 # define __make_section_unallocated(section_string) \
229 asm (".section " section_string "\n\t.previous");
230 # elif defined HAVE_ASM_POPSECTION_DIRECTIVE
231 # define __make_section_unallocated(section_string) \
232 asm (".pushsection " section_string "\n\t.popsection");
234 # define __make_section_unallocated(section_string)
237 /* Tacking on "\n\t#" to the section name makes gcc put it's bogus
238 section attributes on what looks like a comment to the assembler. */
239 # ifdef HAVE_SECTION_QUOTES
240 # define __sec_comment "\"\n\t#\""
242 # define __sec_comment "\n\t#"
244 # define link_warning(symbol, msg) \
245 __make_section_unallocated (".gnu.warning." #symbol) \
246 static const char __evoke_link_warning_##symbol[] \
247 __attribute__ ((used, section (".gnu.warning." #symbol __sec_comment))) \
249 # define libc_freeres_ptr(decl) \
250 __make_section_unallocated ("__libc_freeres_ptrs, \"aw\", %nobits") \
251 decl __attribute__ ((section ("__libc_freeres_ptrs" __sec_comment)))
252 # define __libc_freeres_fn_section \
253 __attribute__ ((section ("__libc_freeres_fn")))
254 # else /* Not ELF: a.out */
256 /* XCOFF does not support .stabs.
257 The native aix linker will remove the .stab and .stabstr sections
258 The gnu linker will have a fatal error if there is a relocation for
259 symbol in the .stab section. Silently disable this macro. */
260 # define link_warning(symbol, msg)
262 # define link_warning(symbol, msg) \
263 asm (".stabs \"" msg "\",30,0,0,0\n\t" \
264 ".stabs \"" __SYMBOL_PREFIX #symbol "\",1,0,0,0\n");
266 # define libc_freeres_ptr(decl) decl
267 # define __libc_freeres_fn_section
270 /* We will never be heard; they will all die horribly. */
271 # define link_warning(symbol, msg)
272 # define libc_freeres_ptr(decl) decl
273 # define __libc_freeres_fn_section
275 #define libc_freeres_fn(name) \
276 static void name (void) __attribute_used__ __libc_freeres_fn_section; \
277 text_set_element (__libc_subfreeres, name); \
278 static void name (void)
280 /* A canned warning for sysdeps/stub functions. */
281 #define stub_warning(name) \
282 __make_section_unallocated (".gnu.glibc-stub." #name) \
283 link_warning (name, \
284 "warning: " #name " is not implemented and will always fail")
286 /* Warning for linking functions calling dlopen into static binaries. */
288 #define static_link_warning(name)
290 #define static_link_warning(name) static_link_warning1(name)
291 #define static_link_warning1(name) \
292 link_warning(name, "Using '" #name "' in statically linked applications \
293 requires at runtime the shared libraries from the glibc version used \
297 /* Declare SYMBOL to be TYPE (`function' or `object') and of SIZE bytes,
298 when the assembler supports such declarations (such as in ELF).
299 This is only necessary when defining something in assembly, or playing
300 funny alias games where the size should be other than what the compiler
302 #define declare_symbol(symbol, type, size) \
303 declare_symbol_1 (symbol, type, size)
304 #ifdef ASM_TYPE_DIRECTIVE_PREFIX
305 # ifdef __ASSEMBLER__
306 # define declare_symbol_1(symbol, type, size) \
307 .type C_SYMBOL_NAME (symbol), \
308 declare_symbol_1_paste (ASM_TYPE_DIRECTIVE_PREFIX, type), size
309 # define declare_symbol_1_paste(a, b) declare_symbol_1_paste_1 (a,b)
310 # define declare_symbol_1_paste_1(a,b) a##b
311 # else /* Not __ASSEMBLER__. */
312 # define declare_symbol_1(symbol, type, size) \
313 asm (".type " __SYMBOL_PREFIX #symbol ", " \
314 declare_symbol_1_stringify (ASM_TYPE_DIRECTIVE_PREFIX) #type \
315 "\n\t.size " __SYMBOL_PREFIX #symbol ", " #size);
316 # define declare_symbol_1_stringify(x) declare_symbol_1_stringify_1 (x)
317 # define declare_symbol_1_stringify_1(x) #x
318 # endif /* __ASSEMBLER__ */
320 # define declare_symbol_1(symbol, type, size) /* Nothing. */
330 /* Symbol set support macros. */
334 /* Make SYMBOL, which is in the text segment, an element of SET. */
335 # define text_set_element(set, symbol) _elf_set_element(set, symbol)
336 /* Make SYMBOL, which is in the data segment, an element of SET. */
337 # define data_set_element(set, symbol) _elf_set_element(set, symbol)
338 /* Make SYMBOL, which is in the bss segment, an element of SET. */
339 # define bss_set_element(set, symbol) _elf_set_element(set, symbol)
341 /* These are all done the same way in ELF.
342 There is a new section created for each set. */
344 /* When building a shared library, make the set section writable,
345 because it will need to be relocated at run time anyway. */
346 # define _elf_set_element(set, symbol) \
347 static const void *__elf_set_##set##_element_##symbol##__ \
348 __attribute__ ((used, section (#set))) = &(symbol)
350 # define _elf_set_element(set, symbol) \
351 static const void *const __elf_set_##set##_element_##symbol##__ \
352 __attribute__ ((used, section (#set))) = &(symbol)
355 /* Define SET as a symbol set. This may be required (it is in a.out) to
356 be able to use the set's contents. */
357 # define symbol_set_define(set) symbol_set_declare(set)
359 /* Declare SET for use in this module, if defined in another module.
360 In a shared library, this is always local to that shared object.
361 For static linking, the set might be wholly absent and so we use
363 # define symbol_set_declare(set) \
364 extern char const __start_##set[] __symbol_set_attribute; \
365 extern char const __stop_##set[] __symbol_set_attribute;
367 # define __symbol_set_attribute attribute_hidden
369 # define __symbol_set_attribute __attribute__ ((weak))
372 /* Return a pointer (void *const *) to the first element of SET. */
373 # define symbol_set_first_element(set) ((void *const *) (&__start_##set))
375 /* Return true iff PTR (a void *const *) has been incremented
376 past the last element in SET. */
377 # define symbol_set_end_p(set, ptr) ((ptr) >= (void *const *) &__stop_##set)
379 # else /* Not ELF: a.out. */
382 /* XCOFF does not support .stabs.
383 The native aix linker will remove the .stab and .stabstr sections
384 The gnu linker will have a fatal error if there is a relocation for
385 symbol in the .stab section. Silently disable these macros. */
386 # define text_set_element(set, symbol)
387 # define data_set_element(set, symbol)
388 # define bss_set_element(set, symbol)
390 # define text_set_element(set, symbol) \
391 asm (".stabs \"" __SYMBOL_PREFIX #set "\",23,0,0," __SYMBOL_PREFIX #symbol)
392 # define data_set_element(set, symbol) \
393 asm (".stabs \"" __SYMBOL_PREFIX #set "\",25,0,0," __SYMBOL_PREFIX #symbol)
394 # define bss_set_element(set, symbol) ?error Must use initialized data.
396 # define symbol_set_define(set) void *const (set)[1];
397 # define symbol_set_declare(set) extern void *const (set)[1];
399 # define symbol_set_first_element(set) &(set)[1]
400 # define symbol_set_end_p(set, ptr) (*(ptr) == 0)
404 /* We cannot do anything in generial. */
405 # define text_set_element(set, symbol) asm ("")
406 # define data_set_element(set, symbol) asm ("")
407 # define bss_set_element(set, symbol) asm ("")
408 # define symbol_set_define(set) void *const (set)[1];
409 # define symbol_set_declare(set) extern void *const (set)[1];
411 # define symbol_set_first_element(set) &(set)[1]
412 # define symbol_set_end_p(set, ptr) (*(ptr) == 0)
413 #endif /* Have GNU ld. */
416 # define symbol_version(real, name, version) \
417 _symbol_version(real, name, version)
418 # define default_symbol_version(real, name, version) \
419 _default_symbol_version(real, name, version)
420 # ifdef __ASSEMBLER__
421 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
422 # define _symbol_version(real, name, version) \
423 .symver real, name##@##version ASM_LINE_SEP \
424 .symver C_SYMBOL_DOT_NAME(real), C_SYMBOL_DOT_NAME(name##@##version)
425 # define _default_symbol_version(real, name, version) \
426 .symver real, name##@##@##version ASM_LINE_SEP \
427 .symver C_SYMBOL_DOT_NAME(real), C_SYMBOL_DOT_NAME(name##@##@##version)
429 # define _symbol_version(real, name, version) \
430 .symver real, name##@##version
431 # define _default_symbol_version(real, name, version) \
432 .symver real, name##@##@##version
435 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
436 # define _symbol_version(real, name, version) \
437 __asm__ (".symver " #real "," #name "@" #version "\n\t" \
438 ".symver ." #real ",." #name "@" #version)
439 # define _default_symbol_version(real, name, version) \
440 __asm__ (".symver " #real "," #name "@@" #version "\n\t" \
441 ".symver ." #real ",." #name "@@" #version)
443 # define _symbol_version(real, name, version) \
444 __asm__ (".symver " #real "," #name "@" #version)
445 # define _default_symbol_version(real, name, version) \
446 __asm__ (".symver " #real "," #name "@@" #version)
450 # define symbol_version(real, name, version)
451 # define default_symbol_version(real, name, version) \
452 strong_alias(real, name)
455 #if defined HAVE_VISIBILITY_ATTRIBUTE \
456 && (defined SHARED || defined LIBC_NONSHARED)
457 # define attribute_hidden __attribute__ ((visibility ("hidden")))
459 # define attribute_hidden
462 #ifdef HAVE_TLS_MODEL_ATTRIBUTE
463 # define attribute_tls_model_ie __attribute__ ((tls_model ("initial-exec")))
465 # define attribute_tls_model_ie
469 # define attribute_relro __attribute__ ((section (".data.rel.ro")))
471 # define attribute_relro
474 /* Handling on non-exported internal names. We have to do this only
477 # define INTUSE(name) name##_internal
478 # define INTDEF(name) strong_alias (name, name##_internal)
479 # define INTVARDEF(name) \
480 _INTVARDEF (name, name##_internal)
481 # if defined HAVE_VISIBILITY_ATTRIBUTE
482 # define _INTVARDEF(name, aliasname) \
483 extern __typeof (name) aliasname __attribute__ ((alias (#name), \
484 visibility ("hidden")));
486 # define _INTVARDEF(name, aliasname) \
487 extern __typeof (name) aliasname __attribute__ ((alias (#name)));
489 # define INTDEF2(name, newname) strong_alias (name, newname##_internal)
490 # define INTVARDEF2(name, newname) _INTVARDEF (name, newname##_internal)
492 # define INTUSE(name) name
493 # define INTDEF(name)
494 # define INTVARDEF(name)
495 # define INTDEF2(name, newname)
496 # define INTVARDEF2(name, newname)
499 /* The following macros are used for PLT bypassing within libc.so
500 (and if needed other libraries similarly).
501 First of all, you need to have the function prototyped somewhere,
506 If calls to foo within libc.so should always go to foo defined in libc.so,
507 then in include/foo.h you add:
509 libc_hidden_proto (foo)
511 line and after the foo function definition:
517 libc_hidden_def (foo)
525 libc_hidden_weak (foo)
527 Simularly for global data. If references to foo within libc.so should
528 always go to foo defined in libc.so, then in include/foo.h you add:
530 libc_hidden_proto (foo)
532 line and after foo's definition:
534 int foo = INITIAL_FOO_VALUE;
535 libc_hidden_data_def (foo)
539 int foo = INITIAL_FOO_VALUE;
540 libc_hidden_data_weak (foo)
542 If foo is normally just an alias (strong or weak) of some other function,
543 you should use the normal strong_alias first, then add libc_hidden_def
550 strong_alias (baz, foo)
551 libc_hidden_weak (foo)
553 If the function should be internal to multiple objects, say ld.so and
554 libc.so, the best way is to use:
556 #if !defined NOT_IN_libc || defined IS_IN_rtld
560 in include/foo.h and the normal macros at all function definitions
561 depending on what DSO they belong to.
563 If versioned_symbol macro is used to define foo,
564 libc_hidden_ver macro should be used, as in:
566 int __real_foo (int __bar)
570 versioned_symbol (libc, __real_foo, foo, GLIBC_2_1);
571 libc_hidden_ver (__real_foo, foo) */
573 #if defined SHARED && defined DO_VERSIONING \
574 && !defined HAVE_BROKEN_ALIAS_ATTRIBUTE && !defined NO_HIDDEN
575 # ifndef __ASSEMBLER__
576 # if !defined HAVE_VISIBILITY_ATTRIBUTE \
577 || defined HAVE_BROKEN_VISIBILITY_ATTRIBUTE
578 # define __hidden_proto_hiddenattr(attrs...)
580 # define __hidden_proto_hiddenattr(attrs...) \
581 __attribute__ ((visibility ("hidden"), ##attrs))
583 # define hidden_proto(name, attrs...) \
584 __hidden_proto (name, __GI_##name, ##attrs)
585 # define __hidden_proto(name, internal, attrs...) \
586 extern __typeof (name) name __asm__ (__hidden_asmname (#internal)) \
587 __hidden_proto_hiddenattr (attrs);
588 # define __hidden_asmname(name) \
589 __hidden_asmname1 (__USER_LABEL_PREFIX__, name)
590 # define __hidden_asmname1(prefix, name) __hidden_asmname2(prefix, name)
591 # define __hidden_asmname2(prefix, name) #prefix name
592 # define __hidden_ver1(local, internal, name) \
593 extern __typeof (name) __EI_##name __asm__(__hidden_asmname (#internal)); \
594 extern __typeof (name) __EI_##name \
595 __attribute__((alias (__hidden_asmname (#local))))
596 # define hidden_ver(local, name) __hidden_ver1(local, __GI_##name, name);
597 # define hidden_data_ver(local, name) hidden_ver(local, name)
598 # define hidden_def(name) __hidden_ver1(__GI_##name, name, name);
599 # define hidden_data_def(name) hidden_def(name)
600 # define hidden_weak(name) \
601 __hidden_ver1(__GI_##name, name, name) __attribute__((weak));
602 # define hidden_data_weak(name) hidden_weak(name)
604 /* For assembly, we need to do the opposite of what we do in C:
605 in assembly gcc __REDIRECT stuff is not in place, so functions
606 are defined by its normal name and we need to create the
607 __GI_* alias to it, in C __REDIRECT causes the function definition
608 to use __GI_* name and we need to add alias to the real name.
609 There is no reason to use hidden_weak over hidden_def in assembly,
610 but we provide it for consistency with the C usage.
611 hidden_proto doesn't make sense for assembly but the equivalent
612 is to call via the HIDDEN_JUMPTARGET macro instead of JUMPTARGET. */
613 # define hidden_def(name) strong_alias (name, __GI_##name)
614 # define hidden_weak(name) hidden_def (name)
615 # define hidden_ver(local, name) strong_alias (local, __GI_##name)
616 # define hidden_data_def(name) strong_data_alias (name, __GI_##name)
617 # define hidden_data_weak(name) hidden_data_def (name)
618 # define hidden_data_ver(local, name) strong_data_alias (local, __GI_##name)
619 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
620 # define HIDDEN_JUMPTARGET(name) .__GI_##name
622 # define HIDDEN_JUMPTARGET(name) __GI_##name
626 # ifndef __ASSEMBLER__
627 # define hidden_proto(name, attrs...)
629 # define HIDDEN_JUMPTARGET(name) JUMPTARGET(name)
630 # endif /* Not __ASSEMBLER__ */
631 # define hidden_weak(name)
632 # define hidden_def(name)
633 # define hidden_ver(local, name)
634 # define hidden_data_weak(name)
635 # define hidden_data_def(name)
636 # define hidden_data_ver(local, name)
639 #if !defined NOT_IN_libc
640 # define libc_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
641 # define libc_hidden_def(name) hidden_def (name)
642 # define libc_hidden_weak(name) hidden_weak (name)
643 # define libc_hidden_ver(local, name) hidden_ver (local, name)
644 # define libc_hidden_data_def(name) hidden_data_def (name)
645 # define libc_hidden_data_weak(name) hidden_data_weak (name)
646 # define libc_hidden_data_ver(local, name) hidden_data_ver (local, name)
648 # define libc_hidden_proto(name, attrs...)
649 # define libc_hidden_def(name)
650 # define libc_hidden_weak(name)
651 # define libc_hidden_ver(local, name)
652 # define libc_hidden_data_def(name)
653 # define libc_hidden_data_weak(name)
654 # define libc_hidden_data_ver(local, name)
657 #if defined NOT_IN_libc && defined IS_IN_rtld
658 # define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
659 # define rtld_hidden_def(name) hidden_def (name)
660 # define rtld_hidden_weak(name) hidden_weak (name)
661 # define rtld_hidden_ver(local, name) hidden_ver (local, name)
662 # define rtld_hidden_data_def(name) hidden_data_def (name)
663 # define rtld_hidden_data_weak(name) hidden_data_weak (name)
664 # define rtld_hidden_data_ver(local, name) hidden_data_ver (local, name)
666 # define rtld_hidden_proto(name, attrs...)
667 # define rtld_hidden_def(name)
668 # define rtld_hidden_weak(name)
669 # define rtld_hidden_ver(local, name)
670 # define rtld_hidden_data_def(name)
671 # define rtld_hidden_data_weak(name)
672 # define rtld_hidden_data_ver(local, name)
675 #if defined NOT_IN_libc && defined IS_IN_libm
676 # define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
677 # define libm_hidden_def(name) hidden_def (name)
678 # define libm_hidden_weak(name) hidden_weak (name)
679 # define libm_hidden_ver(local, name) hidden_ver (local, name)
680 # define libm_hidden_data_def(name) hidden_data_def (name)
681 # define libm_hidden_data_weak(name) hidden_data_weak (name)
682 # define libm_hidden_data_ver(local, name) hidden_data_ver (local, name)
684 # define libm_hidden_proto(name, attrs...)
685 # define libm_hidden_def(name)
686 # define libm_hidden_weak(name)
687 # define libm_hidden_ver(local, name)
688 # define libm_hidden_data_def(name)
689 # define libm_hidden_data_weak(name)
690 # define libm_hidden_data_ver(local, name)
693 #if defined NOT_IN_libc && defined IS_IN_libresolv
694 # define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
695 # define libresolv_hidden_def(name) hidden_def (name)
696 # define libresolv_hidden_weak(name) hidden_weak (name)
697 # define libresolv_hidden_ver(local, name) hidden_ver (local, name)
698 # define libresolv_hidden_data_def(name) hidden_data_def (name)
699 # define libresolv_hidden_data_weak(name) hidden_data_weak (name)
700 # define libresolv_hidden_data_ver(local, name) hidden_data_ver (local, name)
702 # define libresolv_hidden_proto(name, attrs...)
703 # define libresolv_hidden_def(name)
704 # define libresolv_hidden_weak(name)
705 # define libresolv_hidden_ver(local, name)
706 # define libresolv_hidden_data_def(name)
707 # define libresolv_hidden_data_weak(name)
708 # define libresolv_hidden_data_ver(local, name)
711 #if defined NOT_IN_libc && defined IS_IN_librt
712 # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
713 # define librt_hidden_def(name) hidden_def (name)
714 # define librt_hidden_weak(name) hidden_weak (name)
715 # define librt_hidden_ver(local, name) hidden_ver (local, name)
716 # define librt_hidden_data_def(name) hidden_data_def (name)
717 # define librt_hidden_data_weak(name) hidden_data_weak (name)
718 # define librt_hidden_data_ver(local, name) hidden_data_ver (local, name)
720 # define librt_hidden_proto(name, attrs...)
721 # define librt_hidden_def(name)
722 # define librt_hidden_weak(name)
723 # define librt_hidden_ver(local, name)
724 # define librt_hidden_data_def(name)
725 # define librt_hidden_data_weak(name)
726 # define librt_hidden_data_ver(local, name)
729 #if defined NOT_IN_libc && defined IS_IN_libdl
730 # define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
731 # define libdl_hidden_def(name) hidden_def (name)
732 # define libdl_hidden_weak(name) hidden_weak (name)
733 # define libdl_hidden_ver(local, name) hidden_ver (local, name)
734 # define libdl_hidden_data_def(name) hidden_data_def (name)
735 # define libdl_hidden_data_weak(name) hidden_data_weak (name)
736 # define libdl_hidden_data_ver(local, name) hidden_data_ver (local, name)
738 # define libdl_hidden_proto(name, attrs...)
739 # define libdl_hidden_def(name)
740 # define libdl_hidden_weak(name)
741 # define libdl_hidden_ver(local, name)
742 # define libdl_hidden_data_def(name)
743 # define libdl_hidden_data_weak(name)
744 # define libdl_hidden_data_ver(local, name)
747 #if defined NOT_IN_libc && defined IS_IN_libnss_files
748 # define libnss_files_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
749 # define libnss_files_hidden_def(name) hidden_def (name)
750 # define libnss_files_hidden_weak(name) hidden_weak (name)
751 # define libnss_files_hidden_ver(local, name) hidden_ver (local, name)
752 # define libnss_files_hidden_data_def(name) hidden_data_def (name)
753 # define libnss_files_hidden_data_weak(name) hidden_data_weak (name)
754 # define libnss_files_hidden_data_ver(local, name) hidden_data_ver(local, name)
756 # define libnss_files_hidden_proto(name, attrs...)
757 # define libnss_files_hidden_def(name)
758 # define libnss_files_hidden_weak(name)
759 # define libnss_files_hidden_ver(local, name)
760 # define libnss_files_hidden_data_def(name)
761 # define libnss_files_hidden_data_weak(name)
762 # define libnss_files_hidden_data_ver(local, name)
765 #if defined NOT_IN_libc && defined IS_IN_libnsl
766 # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
767 # define libnsl_hidden_def(name) hidden_def (name)
768 # define libnsl_hidden_weak(name) hidden_weak (name)
769 # define libnsl_hidden_ver(local, name) hidden_ver (local, name)
770 # define libnsl_hidden_data_def(name) hidden_data_def (name)
771 # define libnsl_hidden_data_weak(name) hidden_data_weak (name)
772 # define libnsl_hidden_data_ver(local, name) hidden_data_ver (local, name)
774 # define libnsl_hidden_proto(name, attrs...)
775 # define libnsl_hidden_def(name)
776 # define libnsl_hidden_weak(name)
777 # define libnsl_hidden_ver(local, name)
778 # define libnsl_hidden_data_def(name)
779 # define libnsl_hidden_data_weak(name)
780 # define libnsl_hidden_data_ver(local, name)
783 #if defined NOT_IN_libc && defined IS_IN_libnss_nisplus
784 # define libnss_nisplus_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
785 # define libnss_nisplus_hidden_def(name) hidden_def (name)
786 # define libnss_nisplus_hidden_weak(name) hidden_weak (name)
787 # define libnss_nisplus_hidden_ver(local, name) hidden_ver (local, name)
788 # define libnss_nisplus_hidden_data_def(name) hidden_data_def (name)
789 # define libnss_nisplus_hidden_data_weak(name) hidden_data_weak (name)
790 # define libnss_nisplus_hidden_data_ver(local, name) hidden_data_ver (local, name)
792 # define libnss_nisplus_hidden_proto(name, attrs...)
793 # define libnss_nisplus_hidden_def(name)
794 # define libnss_nisplus_hidden_weak(name)
795 # define libnss_nisplus_hidden_ver(local, name)
796 # define libnss_nisplus_hidden_data_def(name)
797 # define libnss_nisplus_hidden_data_weak(name)
798 # define libnss_nisplus_hidden_data_ver(local, name)
801 #ifdef HAVE_BUILTIN_REDIRECTION
802 # define libc_hidden_builtin_proto(name, attrs...) libc_hidden_proto (name, ##attrs)
803 # define libc_hidden_builtin_def(name) libc_hidden_def (name)
804 # define libc_hidden_builtin_weak(name) libc_hidden_weak (name)
805 # define libc_hidden_builtin_ver(local, name) libc_hidden_ver (local, name)
806 # ifdef __ASSEMBLER__
807 # define HIDDEN_BUILTIN_JUMPTARGET(name) HIDDEN_JUMPTARGET(name)
810 # define libc_hidden_builtin_proto(name, attrs...)
811 # define libc_hidden_builtin_def(name)
812 # define libc_hidden_builtin_weak(name)
813 # define libc_hidden_builtin_ver(local, name)
814 # ifdef __ASSEMBLER__
815 # define HIDDEN_BUILTIN_JUMPTARGET(name) JUMPTARGET(name)
819 #if defined NOT_IN_libc && defined IS_IN_libutil
820 # define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
821 # define libutil_hidden_def(name) hidden_def (name)
822 # define libutil_hidden_weak(name) hidden_weak (name)
823 # define libutil_hidden_ver(local, name) hidden_ver (local, name)
824 # define libutil_hidden_data_def(name) hidden_data_def (name)
825 # define libutil_hidden_data_weak(name) hidden_data_weak (name)
826 # define libutil_hidden_data_ver(local, name) hidden_data_ver (local, name)
828 # define libutil_hidden_proto(name, attrs...)
829 # define libutil_hidden_def(name)
830 # define libutil_hidden_weak(name)
831 # define libutil_hidden_ver(local, name)
832 # define libutil_hidden_data_def(name)
833 # define libutil_hidden_data_weak(name)
834 # define libutil_hidden_data_ver(local, name)
837 /* Get some dirty hacks. */
838 #include <symbol-hacks.h>
840 /* Move compatibility symbols out of the way by placing them all in a
842 #ifndef __ASSEMBLER__
843 # define attribute_compat_text_section \
844 __attribute__ ((section (".text.compat")))
845 # define attribute_compat_data_section \
846 __attribute__ ((section (".data.compat")))
848 # define compat_text_section .section ".text.compat", "ax";
849 # define compat_data_section .section ".data.compat", "aw";
852 #endif /* libc-symbols.h */