libc-symbols.h 25 KB

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