libc-symbols.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
  1. /* Support macros for making weak and strong aliases for symbols,
  2. and for using symbol sets and linker warnings with GNU ld.
  3. Copyright (C) 1995-1998,2000-2003,2004,2005,2006
  4. Free Software Foundation, Inc.
  5. This file is part of the GNU C Library.
  6. 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.
  10. The GNU C Library is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. Lesser General Public License for more details.
  14. You should have received a copy of the GNU Lesser General Public
  15. License along with the GNU C Library; if not, see
  16. <http://www.gnu.org/licenses/>. */
  17. #ifndef _LIBC_SYMBOLS_H
  18. #define _LIBC_SYMBOLS_H 1
  19. /* This is defined for the compilation of all C library code. features.h
  20. tests this to avoid inclusion of stubs.h while compiling the library,
  21. before stubs.h has been generated. Some library code that is shared
  22. with other packages also tests this symbol to see if it is being
  23. compiled as part of the C library. We must define this before including
  24. config.h, because it makes some definitions conditional on whether libc
  25. itself is being compiled, or just some generator program. */
  26. #define _LIBC 1
  27. /* This file's macros are included implicitly in the compilation of every
  28. file in the C library by -imacros.
  29. We include uClibc_arch_features.h which is defined by arch devs.
  30. It should define for us the following symbols:
  31. * HAVE_ASM_SET_DIRECTIVE if we have `.set B, A' instead of `A = B'.
  32. * ASM_GLOBAL_DIRECTIVE with `.globl' or `.global'.
  33. * ASM_TYPE_DIRECTIVE_PREFIX with `@' or `#' or whatever for .type,
  34. or leave it undefined if there is no .type directive.
  35. * HAVE_ELF if using ELF, which supports weak symbols using `.weak'.
  36. * HAVE_ASM_WEAK_DIRECTIVE if we have weak symbols using `.weak'.
  37. * HAVE_ASM_WEAKEXT_DIRECTIVE if we have weak symbols using `.weakext'.
  38. */
  39. #include <bits/uClibc_arch_features.h>
  40. /* Enable declarations of GNU extensions, since we are compiling them. */
  41. #define _GNU_SOURCE 1
  42. /* Prepare for the case that `__builtin_expect' is not available. */
  43. #if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ < 96
  44. # define __builtin_expect(x, expected_value) (x)
  45. #endif
  46. #ifndef likely
  47. # define likely(x) __builtin_expect((!!(x)),1)
  48. #endif
  49. #ifndef unlikely
  50. # define unlikely(x) __builtin_expect((!!(x)),0)
  51. #endif
  52. #if defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
  53. # ifndef __cold
  54. # define __cold __attribute__ ((__cold__))
  55. # endif
  56. # ifndef __hot
  57. # define __hot __attribute__ ((__hot__))
  58. # endif
  59. #else
  60. # ifndef __cold
  61. # define __cold
  62. # endif
  63. # ifndef __hot
  64. # define __hot
  65. # endif
  66. #endif
  67. #ifndef __LINUX_COMPILER_H
  68. # define __LINUX_COMPILER_H
  69. #endif
  70. #ifndef __cast__
  71. # define __cast__(_to)
  72. #endif
  73. #if defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
  74. # define attribute_optimize(x) __attribute__ ((optimize(x)))
  75. #else
  76. # define attribute_optimize(x)
  77. #endif
  78. #define attribute_unused __attribute__ ((unused))
  79. #if defined __GNUC__ || defined __ICC
  80. # define attribute_noreturn __attribute__ ((__noreturn__))
  81. #else
  82. # define attribute_noreturn
  83. #endif
  84. #define libc_freeres_ptr(decl) \
  85. __make_section_unallocated ("__libc_freeres_ptrs, \"aw\", %nobits") \
  86. decl __attribute__ ((section ("__libc_freeres_ptrs" __sec_comment)))
  87. #define __libc_freeres_fn_section \
  88. __attribute__ ((section ("__libc_freeres_fn")))
  89. #ifndef NOT_IN_libc
  90. # define IS_IN_libc 1
  91. #endif
  92. /* Indirect stringification. Doing two levels allows
  93. * the parameter to be a macro itself.
  94. */
  95. #define __stringify_1(x...) #x
  96. #define __stringify(x) __stringify_1(x)
  97. #ifdef __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
  98. # define HAVE_ASM_SET_DIRECTIVE
  99. #else
  100. # undef HAVE_ASM_SET_DIRECTIVE
  101. #endif
  102. #ifdef __UCLIBC_ASM_GLOBAL_DIRECTIVE__
  103. # define ASM_GLOBAL_DIRECTIVE __UCLIBC_ASM_GLOBAL_DIRECTIVE__
  104. #else
  105. # define ASM_GLOBAL_DIRECTIVE .global
  106. #endif
  107. #ifdef __UCLIBC_HAVE_ASM_WEAK_DIRECTIVE__
  108. # define HAVE_ASM_WEAK_DIRECTIVE
  109. #else
  110. # undef HAVE_ASM_WEAK_DIRECTIVE
  111. #endif
  112. #ifdef __UCLIBC_HAVE_ASM_WEAKEXT_DIRECTIVE__
  113. # define HAVE_ASM_WEAKEXT_DIRECTIVE
  114. #else
  115. # undef HAVE_ASM_WEAKEXT_DIRECTIVE
  116. #endif
  117. #ifdef __UCLIBC_HAVE_ASM_CFI_DIRECTIVES__
  118. # define HAVE_ASM_CFI_DIRECTIVES
  119. #else
  120. # undef HAVE_ASM_CFI_DIRECTIVES
  121. #endif
  122. #if defined HAVE_ASM_WEAK_DIRECTIVE || defined HAVE_ASM_WEAKEXT_DIRECTIVE
  123. # define HAVE_WEAK_SYMBOLS
  124. #endif
  125. #undef C_SYMBOL_NAME
  126. #ifndef C_SYMBOL_NAME
  127. # ifndef __UCLIBC_UNDERSCORES__
  128. # define C_SYMBOL_NAME(name) name
  129. # else
  130. # define C_SYMBOL_NAME(name) _##name
  131. # endif
  132. #endif
  133. #ifdef __UCLIBC_ASM_LINE_SEP__
  134. # define ASM_LINE_SEP __UCLIBC_ASM_LINE_SEP__
  135. #else
  136. # define ASM_LINE_SEP ;
  137. #endif
  138. #ifndef __ASSEMBLER__
  139. /* GCC understands weak symbols and aliases; use its interface where
  140. possible, instead of embedded assembly language. */
  141. /* Define ALIASNAME as a strong alias for NAME. */
  142. # define strong_alias(name, aliasname) _strong_alias(name, aliasname)
  143. # define _strong_alias(name, aliasname) \
  144. extern __typeof (name) aliasname __attribute__ ((alias (#name)));
  145. /* Same, but does not check for type match. Use sparingly.
  146. Example: strong_alias(stat,stat64) may fail, this one works: */
  147. # define strong_alias_untyped(name, aliasname) \
  148. _strong_alias_untyped(name, aliasname)
  149. # define _strong_alias_untyped(name, aliasname) \
  150. extern __typeof (aliasname) aliasname __attribute__ ((alias (#name)));
  151. # ifdef HAVE_WEAK_SYMBOLS
  152. /* This comes between the return type and function name in
  153. a function definition to make that definition weak. */
  154. # define weak_function __attribute__ ((weak))
  155. # define weak_const_function __attribute__ ((weak, __const__))
  156. /* Define ALIASNAME as a weak alias for NAME.
  157. If weak aliases are not available, this defines a strong alias. */
  158. # define weak_alias(name, aliasname) _weak_alias (name, aliasname)
  159. # define _weak_alias(name, aliasname) \
  160. extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
  161. /* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */
  162. # define weak_extern(symbol) _weak_extern (weak symbol)
  163. # define _weak_extern(expr) _Pragma (#expr)
  164. # else
  165. # define weak_function /* empty */
  166. # define weak_const_function __attribute__ ((__const__))
  167. # define weak_alias(name, aliasname) strong_alias(name, aliasname)
  168. # define weak_extern(symbol) /* Nothing. */
  169. # endif
  170. #else /* __ASSEMBLER__ */
  171. # ifdef HAVE_ASM_SET_DIRECTIVE
  172. # define strong_alias(original, alias) \
  173. ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias) ASM_LINE_SEP \
  174. .set C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original)
  175. # define strong_data_alias(original, alias) strong_alias(original, alias)
  176. # else
  177. # define strong_alias(original, alias) \
  178. ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias) ASM_LINE_SEP \
  179. C_SYMBOL_NAME(alias) = C_SYMBOL_NAME(original)
  180. # define strong_data_alias(original, alias) strong_alias(original, alias)
  181. # endif
  182. # ifdef HAVE_WEAK_SYMBOLS
  183. # ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
  184. # define weak_alias(original, alias) \
  185. .weakext C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original)
  186. # define weak_extern(symbol) \
  187. .weakext C_SYMBOL_NAME(symbol)
  188. # else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
  189. # ifdef HAVE_ASM_SET_DIRECTIVE
  190. # define weak_alias(original, alias) \
  191. .weak C_SYMBOL_NAME(alias) ASM_LINE_SEP \
  192. .set C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original)
  193. # else /* ! HAVE_ASM_SET_DIRECTIVE */
  194. # define weak_alias(original, alias) \
  195. .weak C_SYMBOL_NAME(alias) ASM_LINE_SEP \
  196. C_SYMBOL_NAME(alias) = C_SYMBOL_NAME(original)
  197. # endif
  198. # define weak_extern(symbol) \
  199. .weak C_SYMBOL_NAME(symbol)
  200. # endif /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
  201. # else /* ! HAVE_WEAK_SYMBOLS */
  202. # define weak_alias(original, alias) strong_alias(original, alias)
  203. # define weak_extern(symbol) /* Nothing */
  204. # endif /* ! HAVE_WEAK_SYMBOLS */
  205. #endif /* __ASSEMBLER__ */
  206. /* On some platforms we can make internal function calls (i.e., calls of
  207. functions not exported) a bit faster by using a different calling
  208. convention. */
  209. #ifndef internal_function
  210. # define internal_function /* empty */
  211. #endif
  212. /* We want the .gnu.warning.SYMBOL section to be unallocated. */
  213. #define __make_section_unallocated(section_string) \
  214. __asm__ (".section " section_string "\n\t.previous");
  215. /* Tacking on "\n#APP\n\t#" to the section name makes gcc put it's bogus
  216. section attributes on what looks like a comment to the assembler. */
  217. #ifdef __sparc__ /* HAVE_SECTION_QUOTES */
  218. # define __sec_comment "\"\n#APP\n\t#\""
  219. #else
  220. # define __sec_comment "\n#APP\n\t#"
  221. #endif
  222. /* When a reference to SYMBOL is encountered, the linker will emit a
  223. warning message MSG. */
  224. #define link_warning(symbol, msg) \
  225. __make_section_unallocated (".gnu.warning." #symbol) \
  226. static const char __evoke_link_warning_##symbol[] \
  227. __attribute__ ((used, section (".gnu.warning." #symbol __sec_comment))) \
  228. = msg;
  229. /* Handling on non-exported internal names. We have to do this only
  230. for shared code. */
  231. #ifdef SHARED
  232. # define INTUSE(name) name##_internal
  233. # define INTDEF(name) strong_alias (name, name##_internal)
  234. # define INTVARDEF(name) _INTVARDEF (name, name##_internal)
  235. # if defined HAVE_VISIBILITY_ATTRIBUTE
  236. # define _INTVARDEF(name, aliasname) \
  237. extern __typeof (name) aliasname __attribute__ ((alias (#name), \
  238. visibility ("hidden")));
  239. # else
  240. # define _INTVARDEF(name, aliasname) \
  241. extern __typeof (name) aliasname __attribute__ ((alias (#name)));
  242. # endif
  243. # define INTDEF2(name, newname) strong_alias (name, newname##_internal)
  244. # define INTVARDEF2(name, newname) _INTVARDEF (name, newname##_internal)
  245. #else
  246. # define INTUSE(name) name
  247. # define INTDEF(name)
  248. # define INTVARDEF(name)
  249. # define INTDEF2(name, newname)
  250. # define INTVARDEF2(name, newname)
  251. #endif
  252. /* The following macros are used for PLT bypassing within libc.so
  253. (and if needed other libraries similarly).
  254. If calls to foo within libc.so should always go to foo defined in libc.so,
  255. then in include/foo.h you add:
  256. int foo(int __bar);
  257. libc_hidden_proto(foo)
  258. line and after the foo function definition:
  259. int foo(int __bar) {
  260. return __bar;
  261. }
  262. libc_hidden_def(foo)
  263. or
  264. int foo(int __bar) {
  265. return __bar;
  266. }
  267. libc_hidden_weak(foo)
  268. Similarly for global data: if references to foo within libc.so
  269. should always go to foo defined in libc.so, then in include/foo.h:
  270. extern int foo;
  271. libc_hidden_proto(foo)
  272. and after foo's definition:
  273. int foo = INITIAL_FOO_VALUE;
  274. libc_hidden_data_def(foo)
  275. or
  276. int foo = INITIAL_FOO_VALUE;
  277. libc_hidden_data_weak(foo)
  278. If foo is normally just an alias (strong or weak) to some other function,
  279. you should use the normal strong_alias first, then add libc_hidden_def
  280. or libc_hidden_weak:
  281. int baz(int __bar) {
  282. return __bar;
  283. }
  284. strong_alias(baz, foo)
  285. libc_hidden_weak(foo)
  286. If the function should be internal to multiple objects, say ld.so and
  287. libc.so, the best way is to use:
  288. #if !defined NOT_IN_libc || defined IS_IN_rtld
  289. hidden_proto(foo)
  290. #endif
  291. in include/foo.h and the normal macros at all function definitions
  292. depending on what DSO they belong to.
  293. If versioned_symbol macro is used to define foo,
  294. libc_hidden_ver macro should be used, as in:
  295. int __real_foo(int __bar) {
  296. return __bar;
  297. }
  298. versioned_symbol(libc, __real_foo, foo, GLIBC_2_1);
  299. libc_hidden_ver(__real_foo, foo)
  300. */
  301. /* uClibc specific (the above comment was copied from glibc):
  302. *
  303. * when ppc64 will be supported, we need changes to support
  304. * strong_data_alias (used by asm hidden_data_def)
  305. *
  306. * no versioning support, hidden[_data]_ver are noop
  307. *
  308. * hidden_def() in asm is _hidden_strong_alias (not strong_alias)
  309. *
  310. * libc_hidden_proto(foo) should be added after declaration
  311. * in the header, or after extern foo... in all source files
  312. * (this is discouraged).
  313. * libc_hidden_def does not hide __GI_foo itself, although the name
  314. * suggests it (hiding is done exclusively by libc_hidden_proto).
  315. FIXME! - ?
  316. * The reasoning to have it after the header w/ foo's prototype is
  317. * to get first the __REDIRECT from original header and then create
  318. * the __GI_foo alias
  319. * Hunt for references which still go through PLT (example for x86):
  320. * build shared lib, then disassemble it and search for <xxx@plt>:
  321. * $ objdump -drx libuClibc-*.so >disasm.txt
  322. * $ grep -F '@plt>:' disasm.txt
  323. *
  324. * In uclibc, malloc/free and related functions should be called
  325. * through PLT (making it possible to use alternative malloc),
  326. * and possibly some __pthread_xxx functions can be called through PLT
  327. * (why?). The rest should not use PLT.
  328. */
  329. #if (defined __GNUC__ && defined __GNUC_MINOR__ \
  330. && (( __GNUC__ >= 3 && __GNUC_MINOR__ >= 3) || __GNUC__ >= 4) \
  331. ) || defined __ICC
  332. # define attribute_hidden __attribute__ ((visibility ("hidden")))
  333. # define attribute_protected __attribute__ ((visibility ("protected")))
  334. # define __hidden_proto_hiddenattr(attrs...) __attribute__ ((visibility ("hidden"), ##attrs))
  335. #else
  336. # define attribute_hidden
  337. # define attribute_protected
  338. # define __hidden_proto_hiddenattr(attrs...)
  339. #endif
  340. #if /*!defined STATIC &&*/ !defined __BCC__
  341. # ifndef __ASSEMBLER__
  342. # define hidden_proto(name, attrs...) __hidden_proto(name, __GI_##name, ##attrs)
  343. # define __hidden_proto(name, internal, attrs...) \
  344. extern __typeof (name) name __asm__ (__hidden_asmname (#internal)) \
  345. __hidden_proto_hiddenattr (attrs);
  346. # define __hidden_asmname(name) __hidden_asmname1 (__USER_LABEL_PREFIX__, name)
  347. # define __hidden_asmname1(prefix, name) __hidden_asmname2(prefix, name)
  348. # define __hidden_asmname2(prefix, name) #prefix name
  349. # define __hidden_ver1(local, internal, name) \
  350. extern __typeof (name) __EI_##name __asm__(__hidden_asmname (#internal)); \
  351. extern __typeof (name) __EI_##name __attribute__((alias (__hidden_asmname1 (,#local))))
  352. # define hidden_ver(local, name) __hidden_ver1(local, __GI_##name, name);
  353. # define hidden_data_ver(local, name) hidden_ver(local, name)
  354. # define hidden_def(name) __hidden_ver1(__GI_##name, name, name);
  355. # define hidden_data_def(name) hidden_def(name)
  356. # define hidden_weak(name) \
  357. __hidden_ver1(__GI_##name, name, name) __attribute__((weak));
  358. # define hidden_data_weak(name) hidden_weak(name)
  359. # else /* __ASSEMBLER__ */
  360. # ifdef HAVE_ASM_SET_DIRECTIVE
  361. # define _hidden_strong_alias(original, alias) \
  362. ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias) ASM_LINE_SEP \
  363. .hidden C_SYMBOL_NAME(alias) ASM_LINE_SEP \
  364. .set C_SYMBOL_NAME(alias),C_SYMBOL_NAME(original)
  365. # else /* dont have .set directive */
  366. # define _hidden_strong_alias(original, alias) \
  367. ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(alias) ASM_LINE_SEP \
  368. .hidden C_SYMBOL_NAME(alias) ASM_LINE_SEP \
  369. C_SYMBOL_NAME(alias) = C_SYMBOL_NAME(original)
  370. # endif
  371. # define _hidden_weak_alias(original, alias) \
  372. .hidden C_SYMBOL_NAME(alias) ASM_LINE_SEP \
  373. weak_alias(original, alias)
  374. /* For assembly, we need to do the opposite of what we do in C:
  375. in assembly gcc __REDIRECT stuff is not in place, so functions
  376. are defined by its normal name and we need to create the
  377. __GI_* alias to it, in C __REDIRECT causes the function definition
  378. to use __GI_* name and we need to add alias to the real name.
  379. There is no reason to use hidden_weak over hidden_def in assembly,
  380. but we provide it for consistency with the C usage.
  381. hidden_proto doesn't make sense for assembly but the equivalent
  382. is to call via the HIDDEN_JUMPTARGET macro instead of JUMPTARGET. */
  383. # define hidden_def(name) _hidden_strong_alias (name, __GI_##name)
  384. # define hidden_weak(name) _hidden_weak_alias (name, __GI_##name)
  385. # define hidden_ver(local, name) strong_alias (local, __GI_##name)
  386. # define hidden_data_def(name) _hidden_strong_alias (name, __GI_##name)
  387. # define hidden_data_weak(name) _hidden_weak_alias (name, __GI_##name)
  388. # define hidden_data_ver(local, name) strong_data_alias (local, __GI_##name)
  389. # define HIDDEN_JUMPTARGET(name) __GI_##name
  390. # endif /* __ASSEMBLER__ */
  391. #else /* not SHARED */
  392. # ifndef __ASSEMBLER__
  393. # define hidden_proto(name, attrs...)
  394. # else
  395. # define HIDDEN_JUMPTARGET(name) name
  396. # endif /* not __ASSEMBLER__ */
  397. # define hidden_weak(name)
  398. # define hidden_def(name)
  399. # define hidden_ver(local, name)
  400. # define hidden_data_weak(name)
  401. # define hidden_data_def(name)
  402. # define hidden_data_ver(local, name)
  403. #endif /* SHARED / not SHARED */
  404. /* uClibc does not support versioning yet. */
  405. #define versioned_symbol(lib, local, symbol, version) /* weak_alias(local, symbol) */
  406. #undef hidden_ver
  407. #define hidden_ver(local, name) /* strong_alias(local, __GI_##name) */
  408. #undef hidden_data_ver
  409. #define hidden_data_ver(local, name) /* strong_alias(local,__GI_##name) */
  410. #if !defined NOT_IN_libc
  411. # define libc_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  412. # define libc_hidden_def(name) hidden_def (name)
  413. # define libc_hidden_weak(name) hidden_weak (name)
  414. # define libc_hidden_ver(local, name) hidden_ver (local, name)
  415. # define libc_hidden_data_def(name) hidden_data_def (name)
  416. # define libc_hidden_data_weak(name) hidden_data_weak (name)
  417. # define libc_hidden_data_ver(local, name) hidden_data_ver (local, name)
  418. #else
  419. # define libc_hidden_proto(name, attrs...)
  420. # define libc_hidden_def(name)
  421. # define libc_hidden_weak(name)
  422. # define libc_hidden_ver(local, name)
  423. # define libc_hidden_data_def(name)
  424. # define libc_hidden_data_weak(name)
  425. # define libc_hidden_data_ver(local, name)
  426. #endif
  427. #if defined NOT_IN_libc && defined IS_IN_rtld
  428. # define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  429. # define rtld_hidden_def(name) hidden_def (name)
  430. # define rtld_hidden_weak(name) hidden_weak (name)
  431. # define rtld_hidden_ver(local, name) hidden_ver (local, name)
  432. # define rtld_hidden_data_def(name) hidden_data_def (name)
  433. # define rtld_hidden_data_weak(name) hidden_data_weak (name)
  434. # define rtld_hidden_data_ver(local, name) hidden_data_ver (local, name)
  435. #else
  436. # define rtld_hidden_proto(name, attrs...)
  437. # define rtld_hidden_def(name)
  438. # define rtld_hidden_weak(name)
  439. # define rtld_hidden_ver(local, name)
  440. # define rtld_hidden_data_def(name)
  441. # define rtld_hidden_data_weak(name)
  442. # define rtld_hidden_data_ver(local, name)
  443. #endif
  444. #if defined NOT_IN_libc && defined IS_IN_libm
  445. # define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  446. # define libm_hidden_def(name) hidden_def (name)
  447. # define libm_hidden_weak(name) hidden_weak (name)
  448. # define libm_hidden_ver(local, name) hidden_ver (local, name)
  449. # define libm_hidden_data_def(name) hidden_data_def (name)
  450. # define libm_hidden_data_weak(name) hidden_data_weak (name)
  451. # define libm_hidden_data_ver(local, name) hidden_data_ver (local, name)
  452. #else
  453. # define libm_hidden_proto(name, attrs...)
  454. # define libm_hidden_def(name)
  455. # define libm_hidden_weak(name)
  456. # define libm_hidden_ver(local, name)
  457. # define libm_hidden_data_def(name)
  458. # define libm_hidden_data_weak(name)
  459. # define libm_hidden_data_ver(local, name)
  460. #endif
  461. #if defined NOT_IN_libc && defined IS_IN_libresolv
  462. # define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  463. # define libresolv_hidden_def(name) hidden_def (name)
  464. # define libresolv_hidden_weak(name) hidden_weak (name)
  465. # define libresolv_hidden_ver(local, name) hidden_ver (local, name)
  466. # define libresolv_hidden_data_def(name) hidden_data_def (name)
  467. # define libresolv_hidden_data_weak(name) hidden_data_weak (name)
  468. # define libresolv_hidden_data_ver(local, name) hidden_data_ver (local, name)
  469. #else
  470. # define libresolv_hidden_proto(name, attrs...)
  471. # define libresolv_hidden_def(name)
  472. # define libresolv_hidden_weak(name)
  473. # define libresolv_hidden_ver(local, name)
  474. # define libresolv_hidden_data_def(name)
  475. # define libresolv_hidden_data_weak(name)
  476. # define libresolv_hidden_data_ver(local, name)
  477. #endif
  478. #if defined NOT_IN_libc && defined IS_IN_librt
  479. # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  480. # define librt_hidden_def(name) hidden_def (name)
  481. # define librt_hidden_weak(name) hidden_weak (name)
  482. # define librt_hidden_ver(local, name) hidden_ver (local, name)
  483. # define librt_hidden_data_def(name) hidden_data_def (name)
  484. # define librt_hidden_data_weak(name) hidden_data_weak (name)
  485. # define librt_hidden_data_ver(local, name) hidden_data_ver (local, name)
  486. #else
  487. # define librt_hidden_proto(name, attrs...)
  488. # define librt_hidden_def(name)
  489. # define librt_hidden_weak(name)
  490. # define librt_hidden_ver(local, name)
  491. # define librt_hidden_data_def(name)
  492. # define librt_hidden_data_weak(name)
  493. # define librt_hidden_data_ver(local, name)
  494. #endif
  495. #if defined NOT_IN_libc && defined IS_IN_libdl
  496. # define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  497. # define libdl_hidden_def(name) hidden_def (name)
  498. # define libdl_hidden_weak(name) hidden_weak (name)
  499. # define libdl_hidden_ver(local, name) hidden_ver (local, name)
  500. # define libdl_hidden_data_def(name) hidden_data_def (name)
  501. # define libdl_hidden_data_weak(name) hidden_data_weak (name)
  502. # define libdl_hidden_data_ver(local, name) hidden_data_ver (local, name)
  503. #else
  504. # define libdl_hidden_proto(name, attrs...)
  505. # define libdl_hidden_def(name)
  506. # define libdl_hidden_weak(name)
  507. # define libdl_hidden_ver(local, name)
  508. # define libdl_hidden_data_def(name)
  509. # define libdl_hidden_data_weak(name)
  510. # define libdl_hidden_data_ver(local, name)
  511. #endif
  512. #if defined NOT_IN_libc && defined IS_IN_libintl
  513. # define libintl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  514. # define libintl_hidden_def(name) hidden_def (name)
  515. # define libintl_hidden_weak(name) hidden_weak (name)
  516. # define libintl_hidden_ver(local, name) hidden_ver (local, name)
  517. # define libintl_hidden_data_def(name) hidden_data_def (name)
  518. # define libintl_hidden_data_weak(name) hidden_data_weak (name)
  519. # define libintl_hidden_data_ver(local, name) hidden_data_ver(local, name)
  520. #else
  521. # define libintl_hidden_proto(name, attrs...)
  522. # define libintl_hidden_def(name)
  523. # define libintl_hidden_weak(name)
  524. # define libintl_hidden_ver(local, name)
  525. # define libintl_hidden_data_def(name)
  526. # define libintl_hidden_data_weak(name)
  527. # define libintl_hidden_data_ver(local, name)
  528. #endif
  529. #if defined NOT_IN_libc && defined IS_IN_libnsl
  530. # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  531. # define libnsl_hidden_def(name) hidden_def (name)
  532. # define libnsl_hidden_weak(name) hidden_weak (name)
  533. # define libnsl_hidden_ver(local, name) hidden_ver (local, name)
  534. # define libnsl_hidden_data_def(name) hidden_data_def (name)
  535. # define libnsl_hidden_data_weak(name) hidden_data_weak (name)
  536. # define libnsl_hidden_data_ver(local, name) hidden_data_ver (local, name)
  537. #else
  538. # define libnsl_hidden_proto(name, attrs...)
  539. # define libnsl_hidden_def(name)
  540. # define libnsl_hidden_weak(name)
  541. # define libnsl_hidden_ver(local, name)
  542. # define libnsl_hidden_data_def(name)
  543. # define libnsl_hidden_data_weak(name)
  544. # define libnsl_hidden_data_ver(local, name)
  545. #endif
  546. #if defined NOT_IN_libc && defined IS_IN_libutil
  547. # define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  548. # define libutil_hidden_def(name) hidden_def (name)
  549. # define libutil_hidden_weak(name) hidden_weak (name)
  550. # define libutil_hidden_ver(local, name) hidden_ver (local, name)
  551. # define libutil_hidden_data_def(name) hidden_data_def (name)
  552. # define libutil_hidden_data_weak(name) hidden_data_weak (name)
  553. # define libutil_hidden_data_ver(local, name) hidden_data_ver (local, name)
  554. #else
  555. # define libutil_hidden_proto(name, attrs...)
  556. # define libutil_hidden_def(name)
  557. # define libutil_hidden_weak(name)
  558. # define libutil_hidden_ver(local, name)
  559. # define libutil_hidden_data_def(name)
  560. # define libutil_hidden_data_weak(name)
  561. # define libutil_hidden_data_ver(local, name)
  562. #endif
  563. #if defined NOT_IN_libc && defined IS_IN_libcrypt
  564. # define libcrypt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  565. # define libcrypt_hidden_def(name) hidden_def (name)
  566. # define libcrypt_hidden_weak(name) hidden_weak (name)
  567. # define libcrypt_hidden_ver(local, name) hidden_ver (local, name)
  568. # define libcrypt_hidden_data_def(name) hidden_data_def (name)
  569. # define libcrypt_hidden_data_weak(name) hidden_data_weak (name)
  570. # define libcrypt_hidden_data_ver(local, name) hidden_data_ver (local, name)
  571. #else
  572. # define libcrypt_hidden_proto(name, attrs...)
  573. # define libcrypt_hidden_def(name)
  574. # define libcrypt_hidden_weak(name)
  575. # define libcrypt_hidden_ver(local, name)
  576. # define libcrypt_hidden_data_def(name)
  577. # define libcrypt_hidden_data_weak(name)
  578. # define libcrypt_hidden_data_ver(local, name)
  579. #endif
  580. #if defined NOT_IN_libc && defined IS_IN_libpthread
  581. # define libpthread_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  582. # define libpthread_hidden_def(name) hidden_def (name)
  583. # define libpthread_hidden_weak(name) hidden_weak (name)
  584. # define libpthread_hidden_ver(local, name) hidden_ver (local, name)
  585. # define libpthread_hidden_data_def(name) hidden_data_def (name)
  586. # define libpthread_hidden_data_weak(name) hidden_data_weak (name)
  587. # define libpthread_hidden_data_ver(local, name) hidden_data_ver (local, name)
  588. #else
  589. # define libpthread_hidden_proto(name, attrs...)
  590. # define libpthread_hidden_def(name)
  591. # define libpthread_hidden_weak(name)
  592. # define libpthread_hidden_ver(local, name)
  593. # define libpthread_hidden_data_def(name)
  594. # define libpthread_hidden_data_weak(name)
  595. # define libpthread_hidden_data_ver(local, name)
  596. #endif
  597. #endif /* libc-symbols.h */