libc-symbols.h 23 KB

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