~ubuntu-branches/ubuntu/quantal/uclibc/quantal

« back to all changes in this revision

Viewing changes to include/libc-symbols.h

  • Committer: Bazaar Package Importer
  • Author(s): Hector Oron
  • Date: 2011-06-11 03:06:20 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110611030620-ywjfvyuqvrpsm282
Tags: 0.9.32-1
* New upstream release
* Add myself as maintainer
* Bump standards version 
* Add Vcs-Git, Vcs-Browser and Homepage fields
* Add watch file 

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
#ifndef unlikely
64
64
# define unlikely(x)    __builtin_expect((!!(x)),0)
65
65
#endif
 
66
#if defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
 
67
# ifndef __cold
 
68
#  define __cold __attribute__ ((__cold__))
 
69
# endif
 
70
# ifndef __hot
 
71
#  define __hot __attribute__ ((__hot__))
 
72
# endif
 
73
#else
 
74
# ifndef __cold
 
75
#  define __cold
 
76
# endif
 
77
# ifndef __hot
 
78
#  define __hot
 
79
# endif
 
80
#endif
66
81
#ifndef __LINUX_COMPILER_H
67
82
# define __LINUX_COMPILER_H
68
83
#endif
71
86
#endif
72
87
 
73
88
#if defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
74
 
# define attribute_optimize(lvl) __attribute__ ((optimize(x)))
 
89
# define attribute_optimize(x) __attribute__ ((optimize(x)))
75
90
#else
76
 
# define attribute_optimize(lvl)
 
91
# define attribute_optimize(x)
77
92
#endif
78
93
 
79
94
#define attribute_unused __attribute__ ((unused))
84
99
# define attribute_noreturn
85
100
#endif
86
101
 
 
102
#define libc_freeres_ptr(decl) \
 
103
      __make_section_unallocated ("__libc_freeres_ptrs, \"aw\", %nobits") \
 
104
  decl __attribute__ ((section ("__libc_freeres_ptrs" __sec_comment)))
 
105
#define __libc_freeres_fn_section \
 
106
      __attribute__ ((section ("__libc_freeres_fn")))
 
107
 
87
108
#ifndef NOT_IN_libc
88
109
# define IS_IN_libc 1
89
110
#endif
168
189
# define strong_alias(name, aliasname) _strong_alias(name, aliasname)
169
190
# define _strong_alias(name, aliasname) \
170
191
  extern __typeof (name) aliasname __attribute__ ((alias (#name)));
 
192
/* Same, but does not check for type match. Use sparingly.
 
193
   Example: strong_alias(stat,stat64) may fail, this one works: */
 
194
# define strong_alias_untyped(name, aliasname) \
 
195
  _strong_alias_untyped(name, aliasname)
 
196
# define _strong_alias_untyped(name, aliasname) \
 
197
  extern __typeof (aliasname) aliasname __attribute__ ((alias (#name)));
171
198
 
172
199
/* This comes between the return type and function name in
173
200
   a function definition to make that definition weak.  */
197
224
 
198
225
# ifdef HAVE_ASM_SET_DIRECTIVE
199
226
#  ifdef HAVE_ASM_GLOBAL_DOT_NAME
200
 
#   define strong_alias(original, alias)                                \
201
 
  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP               \
202
 
  .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original) ASM_LINE_SEP      \
203
 
  ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP           \
204
 
  .set C_SYMBOL_DOT_NAME (alias),C_SYMBOL_DOT_NAME (original)
205
 
#   define strong_data_alias(original, alias)                           \
206
 
  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP               \
207
 
  .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original)
 
227
#   define strong_alias(original, alias) \
 
228
        ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias)               ASM_LINE_SEP \
 
229
        .set    C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original)    ASM_LINE_SEP \
 
230
        ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME(alias)           ASM_LINE_SEP \
 
231
        .set    C_SYMBOL_DOT_NAME(alias),C_SYMBOL_DOT_NAME(original)
 
232
#   define strong_data_alias(original, alias) \
 
233
        ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias)               ASM_LINE_SEP \
 
234
        .set    C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original)
208
235
#  else
209
 
#   define strong_alias(original, alias)                                \
210
 
  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP               \
211
 
  .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original)
 
236
#   define strong_alias(original, alias) \
 
237
        ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias)               ASM_LINE_SEP \
 
238
        .set    C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original)
212
239
#   define strong_data_alias(original, alias) strong_alias(original, alias)
213
240
#  endif
214
241
# else
215
242
#  ifdef HAVE_ASM_GLOBAL_DOT_NAME
216
 
#   define strong_alias(original, alias)                                \
217
 
  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP               \
218
 
  C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP         \
219
 
  ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP           \
220
 
  C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
221
 
#   define strong_data_alias(original, alias)                           \
222
 
  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP               \
223
 
  C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
 
243
#   define strong_alias(original, alias) \
 
244
        ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias)               ASM_LINE_SEP \
 
245
        C_SYMBOL_NAME(alias) = C_SYMBOL_NAME(original)          ASM_LINE_SEP \
 
246
        ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME(alias)           ASM_LINE_SEP \
 
247
        C_SYMBOL_DOT_NAME(alias) = C_SYMBOL_DOT_NAME(original)
 
248
#   define strong_data_alias(original, alias) \
 
249
        ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias)               ASM_LINE_SEP \
 
250
        C_SYMBOL_NAME(alias) = C_SYMBOL_NAME(original)
224
251
#  else
225
 
#   define strong_alias(original, alias)                                \
226
 
  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP               \
227
 
  C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
 
252
#   define strong_alias(original, alias) \
 
253
        ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias)               ASM_LINE_SEP \
 
254
        C_SYMBOL_NAME(alias) = C_SYMBOL_NAME(original)
228
255
#   define strong_data_alias(original, alias) strong_alias(original, alias)
229
256
#  endif
230
257
# endif
232
259
# ifdef HAVE_WEAK_SYMBOLS
233
260
#  ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
234
261
#   ifdef HAVE_ASM_GLOBAL_DOT_NAME
235
 
#    define weak_alias(original, alias)                                 \
236
 
  .weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original) ASM_LINE_SEP \
237
 
  .weakext C_SYMBOL_DOT_NAME (alias), C_SYMBOL_DOT_NAME (original)
 
262
#    define weak_alias(original, alias) \
 
263
        .weakext C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original)   ASM_LINE_SEP \
 
264
        .weakext C_SYMBOL_DOT_NAME(alias),C_SYMBOL_DOT_NAME(original)
238
265
#   else
239
 
#    define weak_alias(original, alias)                                 \
240
 
  .weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original)
 
266
#    define weak_alias(original, alias) \
 
267
        .weakext C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original)
241
268
#   endif
242
 
#   define weak_extern(symbol)                                          \
243
 
  .weakext C_SYMBOL_NAME (symbol)
 
269
#   define weak_extern(symbol) \
 
270
        .weakext C_SYMBOL_NAME(symbol)
244
271
 
245
272
#  else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
246
273
 
247
274
#   ifdef HAVE_ASM_SET_DIRECTIVE
248
275
#    ifdef HAVE_ASM_GLOBAL_DOT_NAME
249
 
#     define weak_alias(original, alias)                                \
250
 
  .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP                              \
251
 
  .set C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original) ASM_LINE_SEP     \
252
 
  .weak C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP                          \
253
 
  .set C_SYMBOL_DOT_NAME (alias), C_SYMBOL_DOT_NAME (original)
 
276
#     define weak_alias(original, alias) \
 
277
        .weak   C_SYMBOL_NAME(alias)                            ASM_LINE_SEP \
 
278
        .set    C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original)    ASM_LINE_SEP \
 
279
        .weak   C_SYMBOL_DOT_NAME(alias)                        ASM_LINE_SEP \
 
280
        .set    C_SYMBOL_DOT_NAME(alias),C_SYMBOL_DOT_NAME(original)
254
281
#    else
255
 
#     define weak_alias(original, alias)                                \
256
 
  .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP                              \
257
 
  .set C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original)
 
282
#     define weak_alias(original, alias) \
 
283
        .weak   C_SYMBOL_NAME(alias)                            ASM_LINE_SEP \
 
284
        .set    C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original)
258
285
#    endif
259
286
#   else /* ! HAVE_ASM_SET_DIRECTIVE */
260
287
#    ifdef HAVE_ASM_GLOBAL_DOT_NAME
261
 
#     define weak_alias(original, alias)                                \
262
 
  .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP                              \
263
 
  C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP         \
264
 
  .weak C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP                          \
265
 
  C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
 
288
#     define weak_alias(original, alias) \
 
289
        .weak   C_SYMBOL_NAME(alias)                            ASM_LINE_SEP \
 
290
        C_SYMBOL_NAME(alias) = C_SYMBOL_NAME(original)          ASM_LINE_SEP \
 
291
        .weak   C_SYMBOL_DOT_NAME(alias)                        ASM_LINE_SEP \
 
292
        C_SYMBOL_DOT_NAME(alias) = C_SYMBOL_DOT_NAME(original)
266
293
#    else
267
 
#     define weak_alias(original, alias)                                \
268
 
  .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP                              \
269
 
  C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
 
294
#     define weak_alias(original, alias) \
 
295
        .weak   C_SYMBOL_NAME(alias)                            ASM_LINE_SEP \
 
296
        C_SYMBOL_NAME(alias) = C_SYMBOL_NAME(original)
270
297
#    endif
271
298
#   endif
272
 
#   define weak_extern(symbol)                                          \
273
 
  .weak C_SYMBOL_NAME (symbol)
 
299
#   define weak_extern(symbol) \
 
300
        .weak   C_SYMBOL_NAME(symbol)
274
301
 
275
302
#  endif /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
276
303
 
282
309
 
283
310
#endif /* __ASSEMBLER__ */
284
311
 
 
312
 
285
313
/* On some platforms we can make internal function calls (i.e., calls of
286
314
   functions not exported) a bit faster by using a different calling
287
315
   convention.  */
289
317
# define internal_function      /* empty */
290
318
#endif
291
319
 
 
320
 
292
321
/* We want the .gnu.warning.SYMBOL section to be unallocated.  */
293
322
#define __make_section_unallocated(section_string)      \
294
323
  __asm__ (".section " section_string "\n\t.previous");
295
324
 
 
325
 
296
326
/* Tacking on "\n#APP\n\t#" to the section name makes gcc put it's bogus
297
327
   section attributes on what looks like a comment to the assembler.  */
298
328
#ifdef __sparc__ /* HAVE_SECTION_QUOTES */
301
331
# define __sec_comment "\n#APP\n\t#"
302
332
#endif
303
333
 
 
334
 
304
335
/* When a reference to SYMBOL is encountered, the linker will emit a
305
336
   warning message MSG.  */
306
337
#define link_warning(symbol, msg) \
314
345
#ifdef SHARED
315
346
# define INTUSE(name) name##_internal
316
347
# define INTDEF(name) strong_alias (name, name##_internal)
317
 
# define INTVARDEF(name) \
318
 
  _INTVARDEF (name, name##_internal)
 
348
# define INTVARDEF(name) _INTVARDEF (name, name##_internal)
319
349
# if defined HAVE_VISIBILITY_ATTRIBUTE
320
350
#  define _INTVARDEF(name, aliasname) \
321
351
  extern __typeof (name) aliasname __attribute__ ((alias (#name), \
334
364
# define INTVARDEF2(name, newname)
335
365
#endif
336
366
 
 
367
 
337
368
/* The following macros are used for PLT bypassing within libc.so
338
369
   (and if needed other libraries similarly).
339
 
   First of all, you need to have the function prototyped somewhere,
340
 
   say in foo/foo.h:
341
 
 
342
 
   int foo (int __bar);
343
370
 
344
371
   If calls to foo within libc.so should always go to foo defined in libc.so,
345
372
   then in include/foo.h you add:
346
373
 
347
 
   libc_hidden_proto (foo)
 
374
   int foo(int __bar);
 
375
   libc_hidden_proto(foo)
348
376
 
349
377
   line and after the foo function definition:
350
378
 
351
 
   int foo (int __bar)
352
 
   {
353
 
     return __bar;
354
 
   }
355
 
   libc_hidden_def (foo)
356
 
 
357
 
   or
358
 
 
359
 
   int foo (int __bar)
360
 
   {
361
 
     return __bar;
362
 
   }
363
 
   libc_hidden_weak (foo)
364
 
 
365
 
   Similarly for global data.  If references to foo within libc.so should
366
 
   always go to foo defined in libc.so, then in include/foo.h you add:
367
 
 
368
 
   libc_hidden_proto (foo)
369
 
 
370
 
   line and after foo's definition:
371
 
 
372
 
   int foo = INITIAL_FOO_VALUE;
373
 
   libc_hidden_data_def (foo)
374
 
 
375
 
   or
376
 
 
377
 
   int foo = INITIAL_FOO_VALUE;
378
 
   libc_hidden_data_weak (foo)
 
379
   int foo(int __bar) {
 
380
     return __bar;
 
381
   }
 
382
   libc_hidden_def(foo)
 
383
 
 
384
   or
 
385
 
 
386
   int foo(int __bar) {
 
387
     return __bar;
 
388
   }
 
389
   libc_hidden_weak(foo)
 
390
 
 
391
   Similarly for global data: if references to foo within libc.so
 
392
   should always go to foo defined in libc.so, then in include/foo.h:
 
393
 
 
394
   extern int foo;
 
395
   libc_hidden_proto(foo)
 
396
 
 
397
   and after foo's definition:
 
398
 
 
399
   int foo = INITIAL_FOO_VALUE;
 
400
   libc_hidden_data_def(foo)
 
401
 
 
402
   or
 
403
 
 
404
   int foo = INITIAL_FOO_VALUE;
 
405
   libc_hidden_data_weak(foo)
379
406
 
380
407
   If foo is normally just an alias (strong or weak) to some other function,
381
408
   you should use the normal strong_alias first, then add libc_hidden_def
382
409
   or libc_hidden_weak:
383
410
 
384
 
   int baz (int __bar)
385
 
   {
 
411
   int baz(int __bar) {
386
412
     return __bar;
387
413
   }
388
 
   strong_alias (baz, foo)
389
 
   libc_hidden_weak (foo)
 
414
   strong_alias(baz, foo)
 
415
   libc_hidden_weak(foo)
390
416
 
391
417
   If the function should be internal to multiple objects, say ld.so and
392
418
   libc.so, the best way is to use:
393
419
 
394
420
   #if !defined NOT_IN_libc || defined IS_IN_rtld
395
 
   hidden_proto (foo)
 
421
   hidden_proto(foo)
396
422
   #endif
397
423
 
398
424
   in include/foo.h and the normal macros at all function definitions
401
427
   If versioned_symbol macro is used to define foo,
402
428
   libc_hidden_ver macro should be used, as in:
403
429
 
404
 
   int __real_foo (int __bar)
405
 
   {
 
430
   int __real_foo(int __bar) {
406
431
     return __bar;
407
432
   }
408
 
   versioned_symbol (libc, __real_foo, foo, GLIBC_2_1);
409
 
   libc_hidden_ver (__real_foo, foo)  */
 
433
   versioned_symbol(libc, __real_foo, foo, GLIBC_2_1);
 
434
   libc_hidden_ver(__real_foo, foo)
 
435
 */
410
436
 
411
437
/* uClibc specific (the above comment was copied from glibc):
412
 
 * a. when ppc64 will be supported, we need changes to support:
 
438
 *
 
439
 * when ppc64 will be supported, we need changes to support
413
440
 * strong_data_alias (used by asm hidden_data_def)
414
 
 * b. libc_hidden_proto(foo) should be added after the header having foo's prototype
415
 
 * or after extern foo... to all source files that should use the internal version
416
 
 * of foo within libc, even to the file defining foo itself, libc_hidden_def does
417
 
 * not hide __GI_foo itself, although the name suggests it (hiding is done exclusively
418
 
 * by libc_hidden_proto). The reasoning to have it after the header w/ foo's prototype is
419
 
 * to get first the __REDIRECT from original header and then create the __GI_foo alias
420
 
 * c. no versioning support, hidden[_data]_ver are noop
421
 
 * d. hidden_def() in asm is _hidden_strong_alias (not strong_alias) */
422
 
 
423
 
/* Arrange to hide uClibc internals */
424
 
#if (defined __GNUC__ && \
425
 
  (defined __GNUC_MINOR__ && ( __GNUC__ >= 3 && __GNUC_MINOR__ >= 3 ) \
426
 
   || __GNUC__ >= 4)) || defined __ICC
 
441
 *
 
442
 * no versioning support, hidden[_data]_ver are noop
 
443
 *
 
444
 * hidden_def() in asm is _hidden_strong_alias (not strong_alias)
 
445
 *
 
446
 * libc_hidden_proto(foo) should be added after declaration
 
447
 * in the header, or after extern foo... in all source files
 
448
 * (this is discouraged).
 
449
 * libc_hidden_def does not hide __GI_foo itself, although the name
 
450
 * suggests it (hiding is done exclusively by libc_hidden_proto).
 
451
 
 
452
FIXME! - ?
 
453
 * The reasoning to have it after the header w/ foo's prototype is
 
454
 * to get first the __REDIRECT from original header and then create
 
455
 * the __GI_foo alias
 
456
 
 
457
 * Hunt for references which still go through PLT (example for x86):
 
458
 * build shared lib, then disassemble it and search for <xxx@plt>:
 
459
 * $ objdump -drx libuClibc-*.so >disasm.txt
 
460
 * $ grep -F '@plt>:' disasm.txt
 
461
 *
 
462
 * In uclibc, malloc/free and related functions should be called
 
463
 * through PLT (making it possible to use alternative malloc),
 
464
 * and possibly some __pthread_xxx functions can be called through PLT
 
465
 * (why?). The rest should not use PLT.
 
466
 */
 
467
 
 
468
#if (defined __GNUC__ && defined __GNUC_MINOR__ \
 
469
        && (( __GNUC__ >= 3 && __GNUC_MINOR__ >= 3) || __GNUC__ >= 4) \
 
470
    ) || defined __ICC
427
471
# define attribute_hidden __attribute__ ((visibility ("hidden")))
 
472
# define attribute_protected __attribute__ ((visibility ("protected")))
428
473
# define __hidden_proto_hiddenattr(attrs...) __attribute__ ((visibility ("hidden"), ##attrs))
429
474
#else
430
475
# define attribute_hidden
 
476
# define attribute_protected
431
477
# define __hidden_proto_hiddenattr(attrs...)
432
478
#endif
433
479
 
434
480
#if /*!defined STATIC &&*/ !defined __BCC__
 
481
 
435
482
# ifndef __ASSEMBLER__
436
 
#  define hidden_proto(name, attrs...) __hidden_proto (name, __GI_##name, ##attrs)
 
483
#  define hidden_proto(name, attrs...) __hidden_proto(name, __GI_##name, ##attrs)
437
484
#  define __hidden_proto(name, internal, attrs...) \
438
 
   extern __typeof (name) name __asm__ (__hidden_asmname (#internal)) \
439
 
   __hidden_proto_hiddenattr (attrs);
 
485
        extern __typeof (name) name __asm__ (__hidden_asmname (#internal)) \
 
486
        __hidden_proto_hiddenattr (attrs);
440
487
#  define __hidden_asmname(name) __hidden_asmname1 (__USER_LABEL_PREFIX__, name)
441
488
#  define __hidden_asmname1(prefix, name) __hidden_asmname2(prefix, name)
442
489
#  define __hidden_asmname2(prefix, name) #prefix name
443
490
#  define __hidden_ver1(local, internal, name) \
444
 
   extern __typeof (name) __EI_##name __asm__(__hidden_asmname (#internal)); \
445
 
   extern __typeof (name) __EI_##name __attribute__((alias (__hidden_asmname1 (,#local))))
 
491
        extern __typeof (name) __EI_##name __asm__(__hidden_asmname (#internal)); \
 
492
        extern __typeof (name) __EI_##name __attribute__((alias (__hidden_asmname1 (,#local))))
446
493
#  define hidden_ver(local, name)       __hidden_ver1(local, __GI_##name, name);
447
494
#  define hidden_data_ver(local, name)  hidden_ver(local, name)
448
495
#  define hidden_def(name)              __hidden_ver1(__GI_##name, name, name);
449
496
#  define hidden_data_def(name)         hidden_def(name)
450
 
#  define hidden_weak(name)     \
 
497
#  define hidden_weak(name) \
451
498
        __hidden_ver1(__GI_##name, name, name) __attribute__((weak));
452
499
#  define hidden_data_weak(name)        hidden_weak(name)
453
500
 
454
501
# else /* __ASSEMBLER__ */
455
 
# ifdef HAVE_ASM_SET_DIRECTIVE
456
 
#  ifdef HAVE_ASM_GLOBAL_DOT_NAME
457
 
#   define _hidden_strong_alias(original, alias)                                \
458
 
  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP               \
459
 
  .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP                            \
460
 
  .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original) ASM_LINE_SEP      \
461
 
  ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP           \
462
 
  .hidden C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP                        \
463
 
  .set C_SYMBOL_DOT_NAME (alias),C_SYMBOL_DOT_NAME (original)
464
 
#  else
465
 
#   define _hidden_strong_alias(original, alias)                                \
466
 
  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP               \
467
 
  .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP                            \
468
 
  .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original)
469
 
#  endif
470
 
# else
471
 
#  ifdef HAVE_ASM_GLOBAL_DOT_NAME
472
 
#   define _hidden_strong_alias(original, alias)                                \
473
 
  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP               \
474
 
  .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP                            \
475
 
  C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP         \
476
 
  ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP           \
477
 
  .hidden C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP                        \
478
 
  C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
479
 
#  else
480
 
#   define _hidden_strong_alias(original, alias)                                \
481
 
  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP               \
482
 
  .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP                            \
483
 
  C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
484
 
#  endif
485
 
# endif
486
 
 
487
 
#  ifdef HAVE_ASM_GLOBAL_DOT_NAME
488
 
#   define _hidden_weak_alias(original, alias)                          \
489
 
     .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP                         \
490
 
     .hidden C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP                     \
491
 
     weak_alias(original, alias)
492
 
#  else
493
 
#   define _hidden_weak_alias(original, alias)                          \
494
 
     .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP                         \
495
 
     weak_alias(original, alias)
 
502
 
 
503
#  ifdef HAVE_ASM_SET_DIRECTIVE
 
504
#   ifdef HAVE_ASM_GLOBAL_DOT_NAME
 
505
#    define _hidden_strong_alias(original, alias) \
 
506
        ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias)               ASM_LINE_SEP \
 
507
        .hidden C_SYMBOL_NAME(alias)                            ASM_LINE_SEP \
 
508
        .set    C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original)    ASM_LINE_SEP \
 
509
        ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME(alias)           ASM_LINE_SEP \
 
510
        .hidden C_SYMBOL_DOT_NAME(alias)                        ASM_LINE_SEP \
 
511
        .set    C_SYMBOL_DOT_NAME(alias),C_SYMBOL_DOT_NAME(original)
 
512
#   else
 
513
#    define _hidden_strong_alias(original, alias) \
 
514
        ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias)               ASM_LINE_SEP \
 
515
        .hidden C_SYMBOL_NAME(alias)                            ASM_LINE_SEP \
 
516
        .set    C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original)
 
517
#   endif
 
518
#  else /* dont have .set directive */
 
519
#   ifdef HAVE_ASM_GLOBAL_DOT_NAME
 
520
#    define _hidden_strong_alias(original, alias) \
 
521
        ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias)               ASM_LINE_SEP \
 
522
        .hidden C_SYMBOL_NAME(alias)                            ASM_LINE_SEP \
 
523
        C_SYMBOL_NAME(alias) = C_SYMBOL_NAME(original)          ASM_LINE_SEP \
 
524
        ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME(alias)           ASM_LINE_SEP \
 
525
        .hidden C_SYMBOL_DOT_NAME(alias)                        ASM_LINE_SEP \
 
526
        C_SYMBOL_DOT_NAME(alias) = C_SYMBOL_DOT_NAME(original)
 
527
#   else
 
528
#    define _hidden_strong_alias(original, alias) \
 
529
        ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias)               ASM_LINE_SEP \
 
530
        .hidden C_SYMBOL_NAME(alias)                            ASM_LINE_SEP \
 
531
        C_SYMBOL_NAME(alias) = C_SYMBOL_NAME(original)
 
532
#   endif
 
533
#  endif
 
534
 
 
535
#  ifdef HAVE_ASM_GLOBAL_DOT_NAME
 
536
#   define _hidden_weak_alias(original, alias) \
 
537
        .hidden C_SYMBOL_NAME(alias)                            ASM_LINE_SEP \
 
538
        .hidden C_SYMBOL_DOT_NAME(alias)                        ASM_LINE_SEP \
 
539
        weak_alias(original, alias)
 
540
#  else
 
541
#   define _hidden_weak_alias(original, alias) \
 
542
        .hidden C_SYMBOL_NAME(alias)                            ASM_LINE_SEP \
 
543
        weak_alias(original, alias)
496
544
#  endif
497
545
 
498
546
/* For assembly, we need to do the opposite of what we do in C:
516
564
#   define HIDDEN_JUMPTARGET(name) __GI_##name
517
565
#  endif
518
566
# endif /* __ASSEMBLER__ */
519
 
#else /* SHARED */
 
567
 
 
568
#else /* not SHARED */
 
569
 
520
570
# ifndef __ASSEMBLER__
521
571
#  define hidden_proto(name, attrs...)
522
572
# else
523
573
#  define HIDDEN_JUMPTARGET(name) name
524
 
# endif /* Not  __ASSEMBLER__ */
 
574
# endif /* not __ASSEMBLER__ */
525
575
# define hidden_weak(name)
526
576
# define hidden_def(name)
527
577
# define hidden_ver(local, name)
528
578
# define hidden_data_weak(name)
529
579
# define hidden_data_def(name)
530
580
# define hidden_data_ver(local, name)
531
 
#endif /* SHARED */
 
581
 
 
582
#endif /* SHARED / not SHARED */
 
583
 
532
584
 
533
585
/* uClibc does not support versioning yet. */
534
586
#define versioned_symbol(lib, local, symbol, version) /* weak_alias(local, symbol) */