libc-symbols.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  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. #if defined(__cris__) || defined(__vax__)
  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. /* 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) \
  229. _INTVARDEF (name, name##_internal)
  230. # if defined HAVE_VISIBILITY_ATTRIBUTE
  231. # define _INTVARDEF(name, aliasname) \
  232. extern __typeof (name) aliasname __attribute__ ((alias (#name), \
  233. visibility ("hidden")));
  234. # else
  235. # define _INTVARDEF(name, aliasname) \
  236. extern __typeof (name) aliasname __attribute__ ((alias (#name)));
  237. # endif
  238. # define INTDEF2(name, newname) strong_alias (name, newname##_internal)
  239. # define INTVARDEF2(name, newname) _INTVARDEF (name, newname##_internal)
  240. #else
  241. # define INTUSE(name) name
  242. # define INTDEF(name)
  243. # define INTVARDEF(name)
  244. # define INTDEF2(name, newname)
  245. # define INTVARDEF2(name, newname)
  246. #endif
  247. /* The following macros are used for PLT bypassing within libc.so
  248. (and if needed other libraries similarly).
  249. First of all, you need to have the function prototyped somewhere,
  250. say in foo/foo.h:
  251. int foo (int __bar);
  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. libc_hidden_proto (foo)
  255. line and after the foo function definition:
  256. int foo (int __bar)
  257. {
  258. return __bar;
  259. }
  260. libc_hidden_def (foo)
  261. or
  262. int foo (int __bar)
  263. {
  264. return __bar;
  265. }
  266. libc_hidden_weak (foo)
  267. Simularly for global data. If references to foo within libc.so should
  268. always go to foo defined in libc.so, then in include/foo.h you add:
  269. libc_hidden_proto (foo)
  270. line 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) of 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. {
  281. return __bar;
  282. }
  283. strong_alias (baz, foo)
  284. libc_hidden_weak (foo)
  285. If the function should be internal to multiple objects, say ld.so and
  286. libc.so, the best way is to use:
  287. #if !defined NOT_IN_libc || defined IS_IN_rtld
  288. hidden_proto (foo)
  289. #endif
  290. in include/foo.h and the normal macros at all function definitions
  291. depending on what DSO they belong to.
  292. If versioned_symbol macro is used to define foo,
  293. libc_hidden_ver macro should be used, as in:
  294. int __real_foo (int __bar)
  295. {
  296. return __bar;
  297. }
  298. versioned_symbol (libc, __real_foo, foo, GLIBC_2_1);
  299. libc_hidden_ver (__real_foo, foo) */
  300. /* uClibc specific (the above comment was copied from glibc):
  301. * a. when ppc64 will be supported, we need changes to support:
  302. * strong_data_alias (used by asm hidden_data_def)
  303. * b. libc_hidden_proto(foo) should be added after the header having foo's prototype
  304. * or after extern foo... to all source files that should use the internal version
  305. * of foo within libc, even to the file defining foo itself, libc_hidden_def does
  306. * not hide __GI_foo itself, although the name suggests it (hiding is done exclusively
  307. * by libc_hidden_proto). The reasoning to have it after the header w/ foo's prototype is
  308. * to get first the __REDIRECT from original header and then create the __GI_foo alias
  309. * c. no versioning support, hidden[_data]_ver are noop
  310. * d. hidden_def() in asm is _hidden_strong_alias (not strong_alias) */
  311. /* Arrange to hide uClibc internals */
  312. #if defined __GNUC__ && defined __GNUC_MINOR__ && \
  313. ( __GNUC__ >= 3 && __GNUC_MINOR__ >= 3 ) || __GNUC__ >= 4
  314. # define attribute_hidden __attribute__ ((visibility ("hidden")))
  315. # define __hidden_proto_hiddenattr(attrs...) __attribute__ ((visibility ("hidden"), ##attrs))
  316. #else
  317. # define attribute_hidden
  318. # define __hidden_proto_hiddenattr(attrs...)
  319. #endif
  320. #if !defined STATIC && !defined __BCC__
  321. # ifndef __ASSEMBLER__
  322. # define hidden_proto(name, attrs...) __hidden_proto (name, __GI_##name, ##attrs)
  323. # define __hidden_proto(name, internal, attrs...) \
  324. extern __typeof (name) name __asm__ (__hidden_asmname (#internal)) \
  325. __hidden_proto_hiddenattr (attrs);
  326. # define __hidden_asmname(name) __hidden_asmname1 (__USER_LABEL_PREFIX__, name)
  327. # define __hidden_asmname1(prefix, name) __hidden_asmname2(prefix, name)
  328. # define __hidden_asmname2(prefix, name) #prefix name
  329. # define __hidden_ver1(local, internal, name) \
  330. extern __typeof (name) __EI_##name __asm__(__hidden_asmname (#internal)); \
  331. extern __typeof (name) __EI_##name __attribute__((alias (__hidden_asmname1 (,#local))))
  332. # define hidden_def(name) __hidden_ver1(__GI_##name, name, name);
  333. # define hidden_data_def(name) hidden_def(name)
  334. # define hidden_weak(name) __hidden_ver1(__GI_##name, name, name) __attribute__((weak));
  335. # define hidden_data_weak(name) hidden_weak(name)
  336. # else /* __ASSEMBLER__ */
  337. # ifdef HAVE_ASM_SET_DIRECTIVE
  338. # ifdef HAVE_ASM_GLOBAL_DOT_NAME
  339. # define _hidden_strong_alias(original, alias) \
  340. ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  341. .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  342. .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original) ASM_LINE_SEP \
  343. ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
  344. .hidden C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
  345. .set C_SYMBOL_DOT_NAME (alias),C_SYMBOL_DOT_NAME (original)
  346. # else
  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)
  351. # endif
  352. # else
  353. # ifdef HAVE_ASM_GLOBAL_DOT_NAME
  354. # define _hidden_strong_alias(original, alias) \
  355. ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  356. .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  357. C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP \
  358. ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
  359. .hidden C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
  360. C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
  361. # else
  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)
  366. # endif
  367. # endif
  368. # ifdef HAVE_ASM_GLOBAL_DOT_NAME
  369. # define _hidden_weak_alias(original, alias) \
  370. .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  371. .hidden C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
  372. weak_alias(original, alias)
  373. # else
  374. # define _hidden_weak_alias(original, alias) \
  375. .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  376. weak_alias(original, alias)
  377. # endif
  378. /* For assembly, we need to do the opposite of what we do in C:
  379. in assembly gcc __REDIRECT stuff is not in place, so functions
  380. are defined by its normal name and we need to create the
  381. __GI_* alias to it, in C __REDIRECT causes the function definition
  382. to use __GI_* name and we need to add alias to the real name.
  383. There is no reason to use hidden_weak over hidden_def in assembly,
  384. but we provide it for consistency with the C usage.
  385. hidden_proto doesn't make sense for assembly but the equivalent
  386. is to call via the HIDDEN_JUMPTARGET macro instead of JUMPTARGET. */
  387. # define hidden_def(name) _hidden_strong_alias (name, __GI_##name)
  388. # define hidden_data_def(name) _hidden_strong_alias (name, __GI_##name)
  389. # define hidden_weak(name) _hidden_weak_alias (name, __GI_##name)
  390. # define hidden_data_weak(name) _hidden_weak_alias (name, __GI_##name)
  391. # define HIDDEN_JUMPTARGET(name) __GI_##name
  392. # endif /* __ASSEMBLER__ */
  393. #else /* SHARED */
  394. # ifndef __ASSEMBLER__
  395. # define hidden_proto(name, attrs...)
  396. # else
  397. # define HIDDEN_JUMPTARGET(name) name
  398. # endif
  399. # define hidden_def(name)
  400. # define hidden_data_def(name)
  401. # define hidden_weak(name)
  402. # define hidden_data_weak(name)
  403. #endif /* SHARED */
  404. /* uClibc does not support versioning yet. */
  405. #define versioned_symbol(lib, local, symbol, version) /* weak_alias(local, symbol) */
  406. #define hidden_ver(local, name) /* strong_alias(local, __GI_##name) */
  407. #define hidden_data_ver(local, name) /* strong_alias(local,__GI_##name) */
  408. #if !defined NOT_IN_libc
  409. # define libc_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  410. # define libc_hidden_def(name) hidden_def (name)
  411. # define libc_hidden_weak(name) hidden_weak (name)
  412. # define libc_hidden_ver(local, name) hidden_ver (local, name)
  413. # define libc_hidden_data_def(name) hidden_data_def (name)
  414. # define libc_hidden_data_weak(name) hidden_data_weak (name)
  415. # define libc_hidden_data_ver(local, name) hidden_data_ver (local, name)
  416. #else
  417. # define libc_hidden_proto(name, attrs...)
  418. # define libc_hidden_def(name)
  419. # define libc_hidden_weak(name)
  420. # define libc_hidden_ver(local, name)
  421. # define libc_hidden_data_def(name)
  422. # define libc_hidden_data_weak(name)
  423. # define libc_hidden_data_ver(local, name)
  424. #endif
  425. #if defined NOT_IN_libc && defined IS_IN_rtld
  426. # define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  427. # define rtld_hidden_def(name) hidden_def (name)
  428. # define rtld_hidden_weak(name) hidden_weak (name)
  429. # define rtld_hidden_ver(local, name) hidden_ver (local, name)
  430. # define rtld_hidden_data_def(name) hidden_data_def (name)
  431. # define rtld_hidden_data_weak(name) hidden_data_weak (name)
  432. # define rtld_hidden_data_ver(local, name) hidden_data_ver (local, name)
  433. #else
  434. # define rtld_hidden_proto(name, attrs...)
  435. # define rtld_hidden_def(name)
  436. # define rtld_hidden_weak(name)
  437. # define rtld_hidden_ver(local, name)
  438. # define rtld_hidden_data_def(name)
  439. # define rtld_hidden_data_weak(name)
  440. # define rtld_hidden_data_ver(local, name)
  441. #endif
  442. #if defined NOT_IN_libc && defined IS_IN_libm
  443. # define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  444. # define libm_hidden_def(name) hidden_def (name)
  445. # define libm_hidden_weak(name) hidden_weak (name)
  446. # define libm_hidden_ver(local, name) hidden_ver (local, name)
  447. # define libm_hidden_data_def(name) hidden_data_def (name)
  448. # define libm_hidden_data_weak(name) hidden_data_weak (name)
  449. # define libm_hidden_data_ver(local, name) hidden_data_ver (local, name)
  450. #else
  451. # define libm_hidden_proto(name, attrs...)
  452. # define libm_hidden_def(name)
  453. # define libm_hidden_weak(name)
  454. # define libm_hidden_ver(local, name)
  455. # define libm_hidden_data_def(name)
  456. # define libm_hidden_data_weak(name)
  457. # define libm_hidden_data_ver(local, name)
  458. #endif
  459. #if defined NOT_IN_libc && defined IS_IN_libresolv
  460. # define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  461. # define libresolv_hidden_def(name) hidden_def (name)
  462. # define libresolv_hidden_weak(name) hidden_weak (name)
  463. # define libresolv_hidden_ver(local, name) hidden_ver (local, name)
  464. # define libresolv_hidden_data_def(name) hidden_data_def (name)
  465. # define libresolv_hidden_data_weak(name) hidden_data_weak (name)
  466. # define libresolv_hidden_data_ver(local, name) hidden_data_ver (local, name)
  467. #else
  468. # define libresolv_hidden_proto(name, attrs...)
  469. # define libresolv_hidden_def(name)
  470. # define libresolv_hidden_weak(name)
  471. # define libresolv_hidden_ver(local, name)
  472. # define libresolv_hidden_data_def(name)
  473. # define libresolv_hidden_data_weak(name)
  474. # define libresolv_hidden_data_ver(local, name)
  475. #endif
  476. #if defined NOT_IN_libc && defined IS_IN_librt
  477. # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  478. # define librt_hidden_def(name) hidden_def (name)
  479. # define librt_hidden_weak(name) hidden_weak (name)
  480. # define librt_hidden_ver(local, name) hidden_ver (local, name)
  481. # define librt_hidden_data_def(name) hidden_data_def (name)
  482. # define librt_hidden_data_weak(name) hidden_data_weak (name)
  483. # define librt_hidden_data_ver(local, name) hidden_data_ver (local, name)
  484. #else
  485. # define librt_hidden_proto(name, attrs...)
  486. # define librt_hidden_def(name)
  487. # define librt_hidden_weak(name)
  488. # define librt_hidden_ver(local, name)
  489. # define librt_hidden_data_def(name)
  490. # define librt_hidden_data_weak(name)
  491. # define librt_hidden_data_ver(local, name)
  492. #endif
  493. #if defined NOT_IN_libc && defined IS_IN_libdl
  494. # define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  495. # define libdl_hidden_def(name) hidden_def (name)
  496. # define libdl_hidden_weak(name) hidden_weak (name)
  497. # define libdl_hidden_ver(local, name) hidden_ver (local, name)
  498. # define libdl_hidden_data_def(name) hidden_data_def (name)
  499. # define libdl_hidden_data_weak(name) hidden_data_weak (name)
  500. # define libdl_hidden_data_ver(local, name) hidden_data_ver (local, name)
  501. #else
  502. # define libdl_hidden_proto(name, attrs...)
  503. # define libdl_hidden_def(name)
  504. # define libdl_hidden_weak(name)
  505. # define libdl_hidden_ver(local, name)
  506. # define libdl_hidden_data_def(name)
  507. # define libdl_hidden_data_weak(name)
  508. # define libdl_hidden_data_ver(local, name)
  509. #endif
  510. #if defined NOT_IN_libc && defined IS_IN_libintl
  511. # define libintl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  512. # define libintl_hidden_def(name) hidden_def (name)
  513. # define libintl_hidden_weak(name) hidden_weak (name)
  514. # define libintl_hidden_ver(local, name) hidden_ver (local, name)
  515. # define libintl_hidden_data_def(name) hidden_data_def (name)
  516. # define libintl_hidden_data_weak(name) hidden_data_weak (name)
  517. # define libintl_hidden_data_ver(local, name) hidden_data_ver(local, name)
  518. #else
  519. # define libintl_hidden_proto(name, attrs...)
  520. # define libintl_hidden_def(name)
  521. # define libintl_hidden_weak(name)
  522. # define libintl_hidden_ver(local, name)
  523. # define libintl_hidden_data_def(name)
  524. # define libintl_hidden_data_weak(name)
  525. # define libintl_hidden_data_ver(local, name)
  526. #endif
  527. #if defined NOT_IN_libc && defined IS_IN_libnsl
  528. # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  529. # define libnsl_hidden_def(name) hidden_def (name)
  530. # define libnsl_hidden_weak(name) hidden_weak (name)
  531. # define libnsl_hidden_ver(local, name) hidden_ver (local, name)
  532. # define libnsl_hidden_data_def(name) hidden_data_def (name)
  533. # define libnsl_hidden_data_weak(name) hidden_data_weak (name)
  534. # define libnsl_hidden_data_ver(local, name) hidden_data_ver (local, name)
  535. #else
  536. # define libnsl_hidden_proto(name, attrs...)
  537. # define libnsl_hidden_def(name)
  538. # define libnsl_hidden_weak(name)
  539. # define libnsl_hidden_ver(local, name)
  540. # define libnsl_hidden_data_def(name)
  541. # define libnsl_hidden_data_weak(name)
  542. # define libnsl_hidden_data_ver(local, name)
  543. #endif
  544. #if defined NOT_IN_libc && defined IS_IN_libutil
  545. # define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  546. # define libutil_hidden_def(name) hidden_def (name)
  547. # define libutil_hidden_weak(name) hidden_weak (name)
  548. # define libutil_hidden_ver(local, name) hidden_ver (local, name)
  549. # define libutil_hidden_data_def(name) hidden_data_def (name)
  550. # define libutil_hidden_data_weak(name) hidden_data_weak (name)
  551. # define libutil_hidden_data_ver(local, name) hidden_data_ver (local, name)
  552. #else
  553. # define libutil_hidden_proto(name, attrs...)
  554. # define libutil_hidden_def(name)
  555. # define libutil_hidden_weak(name)
  556. # define libutil_hidden_ver(local, name)
  557. # define libutil_hidden_data_def(name)
  558. # define libutil_hidden_data_weak(name)
  559. # define libutil_hidden_data_ver(local, name)
  560. #endif
  561. #if defined NOT_IN_libc && defined IS_IN_libcrypt
  562. # define libcrypt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  563. # define libcrypt_hidden_def(name) hidden_def (name)
  564. # define libcrypt_hidden_weak(name) hidden_weak (name)
  565. # define libcrypt_hidden_ver(local, name) hidden_ver (local, name)
  566. # define libcrypt_hidden_data_def(name) hidden_data_def (name)
  567. # define libcrypt_hidden_data_weak(name) hidden_data_weak (name)
  568. # define libcrypt_hidden_data_ver(local, name) hidden_data_ver (local, name)
  569. #else
  570. # define libcrypt_hidden_proto(name, attrs...)
  571. # define libcrypt_hidden_def(name)
  572. # define libcrypt_hidden_weak(name)
  573. # define libcrypt_hidden_ver(local, name)
  574. # define libcrypt_hidden_data_def(name)
  575. # define libcrypt_hidden_data_weak(name)
  576. # define libcrypt_hidden_data_ver(local, name)
  577. #endif
  578. #if defined NOT_IN_libc && defined IS_IN_libpthread
  579. # define libpthread_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  580. # define libpthread_hidden_def(name) hidden_def (name)
  581. # define libpthread_hidden_weak(name) hidden_weak (name)
  582. # define libpthread_hidden_ver(local, name) hidden_ver (local, name)
  583. # define libpthread_hidden_data_def(name) hidden_data_def (name)
  584. # define libpthread_hidden_data_weak(name) hidden_data_weak (name)
  585. # define libpthread_hidden_data_ver(local, name) hidden_data_ver (local, name)
  586. #else
  587. # define libpthread_hidden_proto(name, attrs...)
  588. # define libpthread_hidden_def(name)
  589. # define libpthread_hidden_weak(name)
  590. # define libpthread_hidden_ver(local, name)
  591. # define libpthread_hidden_data_def(name)
  592. # define libpthread_hidden_data_weak(name)
  593. # define libpthread_hidden_data_ver(local, name)
  594. #endif
  595. #endif /* _LIBC_SYMBOLS_H */