libc-symbols.h 22 KB

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