OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [conts/] [posix/] [libposix/] [include/] [posix/] [libc-symbols.h] - Blame information for rev 2

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.