libc-symbols.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  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. #ifdef __UCLIBC_NO_UNDERSCORES__
  47. # define NO_UNDERSCORES
  48. #else
  49. # undef NO_UNDERSCORES
  50. #endif
  51. #ifdef __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
  52. # define HAVE_ASM_SET_DIRECTIVE
  53. #else
  54. # undef HAVE_ASM_SET_DIRECTIVE
  55. #endif
  56. #ifdef __UCLIBC_ASM_GLOBAL_DIRECTIVE__
  57. # define ASM_GLOBAL_DIRECTIVE __UCLIBC_ASM_GLOBAL_DIRECTIVE__
  58. #else
  59. # define ASM_GLOBAL_DIRECTIVE .global
  60. #endif
  61. #ifdef __UCLIBC_HAVE_ASM_WEAK_DIRECTIVE__
  62. # define HAVE_ASM_WEAK_DIRECTIVE
  63. #else
  64. # undef HAVE_ASM_WEAK_DIRECTIVE
  65. #endif
  66. #ifdef __UCLIBC_HAVE_ASM_WEAKEXT_DIRECTIVE__
  67. # define HAVE_ASM_WEAKEXT_DIRECTIVE
  68. #else
  69. # undef HAVE_ASM_WEAKEXT_DIRECTIVE
  70. #endif
  71. #ifdef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
  72. # define HAVE_ASM_GLOBAL_DOT_NAME
  73. #else
  74. # undef HAVE_ASM_GLOBAL_DOT_NAME
  75. #endif
  76. #if defined HAVE_ASM_WEAK_DIRECTIVE || defined HAVE_ASM_WEAKEXT_DIRECTIVE
  77. # define HAVE_WEAK_SYMBOLS
  78. #endif
  79. #undef C_SYMBOL_NAME
  80. #ifndef C_SYMBOL_NAME
  81. # ifdef NO_UNDERSCORES
  82. # define C_SYMBOL_NAME(name) name
  83. # else
  84. # define C_SYMBOL_NAME(name) _##name
  85. # endif
  86. #endif
  87. #ifndef ASM_LINE_SEP
  88. # define ASM_LINE_SEP ;
  89. #endif
  90. #ifdef HAVE_ASM_GLOBAL_DOT_NAME
  91. # ifndef C_SYMBOL_DOT_NAME
  92. # if defined __GNUC__ && defined __GNUC_MINOR__ \
  93. && (__GNUC__ << 16) + __GNUC_MINOR__ >= (3 << 16) + 1
  94. # define C_SYMBOL_DOT_NAME(name) .name
  95. # else
  96. # define C_SYMBOL_DOT_NAME(name) .##name
  97. # endif
  98. # endif
  99. #endif
  100. #ifndef __ASSEMBLER__
  101. /* GCC understands weak symbols and aliases; use its interface where
  102. possible, instead of embedded assembly language. */
  103. /* Define ALIASNAME as a strong alias for NAME. */
  104. # define strong_alias(name, aliasname) _strong_alias(name, aliasname)
  105. # define _strong_alias(name, aliasname) \
  106. extern __typeof (name) aliasname __attribute__ ((alias (#name)));
  107. # ifdef HAVE_WEAK_SYMBOLS
  108. /* This comes between the return type and function name in
  109. a function definition to make that definition weak. */
  110. # define weak_function __attribute__ ((weak))
  111. # define weak_const_function __attribute__ ((weak, __const__))
  112. /* Define ALIASNAME as a weak alias for NAME.
  113. If weak aliases are not available, this defines a strong alias. */
  114. # define weak_alias(name, aliasname) _weak_alias (name, aliasname)
  115. # define _weak_alias(name, aliasname) \
  116. extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
  117. /* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */
  118. # define weak_extern(symbol) _weak_extern (weak symbol)
  119. # define _weak_extern(expr) _Pragma (#expr)
  120. # else
  121. # define weak_function /* empty */
  122. # define weak_const_function /* empty */
  123. # define weak_alias(name, aliasname) strong_alias(name, aliasname)
  124. # define weak_extern(symbol) /* Nothing. */
  125. # endif
  126. #else /* __ASSEMBLER__ */
  127. # ifdef HAVE_ASM_SET_DIRECTIVE
  128. # ifdef HAVE_ASM_GLOBAL_DOT_NAME
  129. # define strong_alias(original, alias) \
  130. ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  131. .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original) ASM_LINE_SEP \
  132. ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
  133. .set C_SYMBOL_DOT_NAME (alias),C_SYMBOL_DOT_NAME (original)
  134. # define strong_data_alias(original, alias) \
  135. ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  136. .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original)
  137. # else
  138. # define strong_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. # define strong_data_alias(original, alias) strong_alias(original, alias)
  142. # endif
  143. # else
  144. # ifdef HAVE_ASM_GLOBAL_DOT_NAME
  145. # define strong_alias(original, alias) \
  146. ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  147. C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP \
  148. ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
  149. C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
  150. # define strong_data_alias(original, alias) \
  151. ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  152. C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
  153. # else
  154. # define strong_alias(original, alias) \
  155. ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  156. C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
  157. # define strong_data_alias(original, alias) strong_alias(original, alias)
  158. # endif
  159. # endif
  160. # ifdef HAVE_WEAK_SYMBOLS
  161. # ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
  162. # ifdef HAVE_ASM_GLOBAL_DOT_NAME
  163. # define weak_alias(original, alias) \
  164. .weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original) ASM_LINE_SEP \
  165. .weakext C_SYMBOL_DOT_NAME (alias), C_SYMBOL_DOT_NAME (original)
  166. # else
  167. # define weak_alias(original, alias) \
  168. .weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original)
  169. # endif
  170. # define weak_extern(symbol) \
  171. .weakext C_SYMBOL_NAME (symbol)
  172. # else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
  173. # ifdef HAVE_ASM_GLOBAL_DOT_NAME
  174. # define weak_alias(original, alias) \
  175. .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  176. C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP \
  177. .weak C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
  178. C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
  179. # else
  180. # define weak_alias(original, alias) \
  181. .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  182. C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
  183. # endif
  184. # define weak_extern(symbol) \
  185. .weak C_SYMBOL_NAME (symbol)
  186. # endif /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
  187. # else /* ! HAVE_WEAK_SYMBOLS */
  188. # define weak_alias(original, alias) strong_alias(original, alias)
  189. # define weak_extern(symbol) /* Nothing */
  190. # endif /* ! HAVE_WEAK_SYMBOLS */
  191. #endif /* __ASSEMBLER__ */
  192. /* On some platforms we can make internal function calls (i.e., calls of
  193. functions not exported) a bit faster by using a different calling
  194. convention. */
  195. #ifndef internal_function
  196. # define internal_function /* empty */
  197. #endif
  198. /* We want the .gnu.warning.SYMBOL section to be unallocated. */
  199. #define __make_section_unallocated(section_string) \
  200. __asm__ (".section " section_string "\n\t.previous");
  201. /* Tacking on "\n\t#" to the section name makes gcc put it's bogus
  202. section attributes on what looks like a comment to the assembler. */
  203. #ifdef __sparc__ //HAVE_SECTION_QUOTES
  204. # define __sec_comment "\"\n\t#\""
  205. #else
  206. # define __sec_comment "\n\t#"
  207. #endif
  208. /* When a reference to SYMBOL is encountered, the linker will emit a
  209. warning message MSG. */
  210. #if defined(__cris__) || defined(__vax__)
  211. # define link_warning(symbol, msg)
  212. #else
  213. # define link_warning(symbol, msg) \
  214. __make_section_unallocated (".gnu.warning." #symbol) \
  215. static const char __evoke_link_warning_##symbol[] \
  216. __attribute__ ((used, section (".gnu.warning." #symbol __sec_comment))) \
  217. = msg;
  218. #endif
  219. /* Handling on non-exported internal names. We have to do this only
  220. for shared code. */
  221. #ifdef SHARED
  222. # define INTUSE(name) name##_internal
  223. # define INTDEF(name) strong_alias (name, name##_internal)
  224. # define INTVARDEF(name) \
  225. _INTVARDEF (name, name##_internal)
  226. # if defined HAVE_VISIBILITY_ATTRIBUTE
  227. # define _INTVARDEF(name, aliasname) \
  228. extern __typeof (name) aliasname __attribute__ ((alias (#name), \
  229. visibility ("hidden")));
  230. # else
  231. # define _INTVARDEF(name, aliasname) \
  232. extern __typeof (name) aliasname __attribute__ ((alias (#name)));
  233. # endif
  234. # define INTDEF2(name, newname) strong_alias (name, newname##_internal)
  235. # define INTVARDEF2(name, newname) _INTVARDEF (name, newname##_internal)
  236. #else
  237. # define INTUSE(name) name
  238. # define INTDEF(name)
  239. # define INTVARDEF(name)
  240. # define INTDEF2(name, newname)
  241. # define INTVARDEF2(name, newname)
  242. #endif
  243. /* The following macros are used for PLT bypassing within libc.so
  244. (and if needed other libraries similarly).
  245. First of all, you need to have the function prototyped somewhere,
  246. say in foo/foo.h:
  247. int foo (int __bar);
  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. libc_hidden_proto (foo)
  251. line and after the foo function definition:
  252. int foo (int __bar)
  253. {
  254. return __bar;
  255. }
  256. libc_hidden_def (foo)
  257. or
  258. int foo (int __bar)
  259. {
  260. return __bar;
  261. }
  262. libc_hidden_weak (foo)
  263. Similarly for global data. If references to foo within libc.so should
  264. always go to foo defined in libc.so, then in include/foo.h you add:
  265. libc_hidden_proto (foo)
  266. line 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) of 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. {
  277. return __bar;
  278. }
  279. strong_alias (baz, foo)
  280. libc_hidden_weak (foo)
  281. If the function should be internal to multiple objects, say ld.so and
  282. libc.so, the best way is to use:
  283. #if !defined NOT_IN_libc || defined IS_IN_rtld
  284. hidden_proto (foo)
  285. #endif
  286. in include/foo.h and the normal macros at all function definitions
  287. depending on what DSO they belong to.
  288. If versioned_symbol macro is used to define foo,
  289. libc_hidden_ver macro should be used, as in:
  290. int __real_foo (int __bar)
  291. {
  292. return __bar;
  293. }
  294. versioned_symbol (libc, __real_foo, foo, GLIBC_2_1);
  295. libc_hidden_ver (__real_foo, foo) */
  296. /* uClibc specific (the above comment was copied from glibc):
  297. * a. when ppc64 will be supported, we need changes to support:
  298. * strong_data_alias (used by asm hidden_data_def)
  299. * b. libc_hidden_proto(foo) should be added after the header having foo's prototype
  300. * or after extern foo... to all source files that should use the internal version
  301. * of foo within libc, even to the file defining foo itself, libc_hidden_def does
  302. * not hide __GI_foo itself, although the name suggests it (hiding is done exclusively
  303. * by libc_hidden_proto). The reasoning to have it after the header w/ foo's prototype is
  304. * to get first the __REDIRECT from original header and then create the __GI_foo alias
  305. * c. no versioning support, hidden[_data]_ver are noop
  306. * d. hidden_def() in asm is _hidden_strong_alias (not strong_alias) */
  307. /* Arrange to hide uClibc internals */
  308. #if defined __GNUC__ && defined __GNUC_MINOR__ && \
  309. ( __GNUC__ >= 3 && __GNUC_MINOR__ >= 3 ) || __GNUC__ >= 4
  310. # define attribute_hidden __attribute__ ((visibility ("hidden")))
  311. # define __hidden_proto_hiddenattr(attrs...) __attribute__ ((visibility ("hidden"), ##attrs))
  312. #else
  313. # define attribute_hidden
  314. # define __hidden_proto_hiddenattr(attrs...)
  315. #endif
  316. #if !defined STATIC && !defined __BCC__
  317. # ifndef __ASSEMBLER__
  318. # define hidden_proto(name, attrs...) __hidden_proto (name, __GI_##name, ##attrs)
  319. # define __hidden_proto(name, internal, attrs...) \
  320. extern __typeof (name) name __asm__ (__hidden_asmname (#internal)) \
  321. __hidden_proto_hiddenattr (attrs);
  322. # define __hidden_asmname(name) __hidden_asmname1 (__USER_LABEL_PREFIX__, name)
  323. # define __hidden_asmname1(prefix, name) __hidden_asmname2(prefix, name)
  324. # define __hidden_asmname2(prefix, name) #prefix name
  325. # define __hidden_ver1(local, internal, name) \
  326. extern __typeof (name) __EI_##name __asm__(__hidden_asmname (#internal)); \
  327. extern __typeof (name) __EI_##name __attribute__((alias (__hidden_asmname1 (,#local))))
  328. # define hidden_def(name) __hidden_ver1(__GI_##name, name, name);
  329. # define hidden_data_def(name) hidden_def(name)
  330. # define hidden_weak(name) __hidden_ver1(__GI_##name, name, name) __attribute__((weak));
  331. # define hidden_data_weak(name) hidden_weak(name)
  332. # else /* __ASSEMBLER__ */
  333. # ifdef HAVE_ASM_SET_DIRECTIVE
  334. # ifdef HAVE_ASM_GLOBAL_DOT_NAME
  335. # define _hidden_strong_alias(original, alias) \
  336. ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  337. .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  338. .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original) ASM_LINE_SEP \
  339. ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
  340. .hidden C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
  341. .set C_SYMBOL_DOT_NAME (alias),C_SYMBOL_DOT_NAME (original)
  342. # else
  343. # define _hidden_strong_alias(original, alias) \
  344. ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  345. .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  346. .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original)
  347. # endif
  348. # else
  349. # ifdef HAVE_ASM_GLOBAL_DOT_NAME
  350. # define _hidden_strong_alias(original, alias) \
  351. ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  352. .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  353. C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP \
  354. ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
  355. .hidden C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
  356. C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
  357. # else
  358. # define _hidden_strong_alias(original, alias) \
  359. ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  360. .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  361. C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
  362. # endif
  363. # endif
  364. # ifdef HAVE_ASM_GLOBAL_DOT_NAME
  365. # define _hidden_weak_alias(original, alias) \
  366. .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  367. .hidden C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
  368. weak_alias(original, alias)
  369. # else
  370. # define _hidden_weak_alias(original, alias) \
  371. .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
  372. weak_alias(original, alias)
  373. # endif
  374. /* For assembly, we need to do the opposite of what we do in C:
  375. in assembly gcc __REDIRECT stuff is not in place, so functions
  376. are defined by its normal name and we need to create the
  377. __GI_* alias to it, in C __REDIRECT causes the function definition
  378. to use __GI_* name and we need to add alias to the real name.
  379. There is no reason to use hidden_weak over hidden_def in assembly,
  380. but we provide it for consistency with the C usage.
  381. hidden_proto doesn't make sense for assembly but the equivalent
  382. is to call via the HIDDEN_JUMPTARGET macro instead of JUMPTARGET. */
  383. # define hidden_def(name) _hidden_strong_alias (name, __GI_##name)
  384. # define hidden_data_def(name) _hidden_strong_alias (name, __GI_##name)
  385. # define hidden_weak(name) _hidden_weak_alias (name, __GI_##name)
  386. # define hidden_data_weak(name) _hidden_weak_alias (name, __GI_##name)
  387. # define HIDDEN_JUMPTARGET(name) __GI_##name
  388. # endif /* __ASSEMBLER__ */
  389. #else /* SHARED */
  390. # ifndef __ASSEMBLER__
  391. # define hidden_proto(name, attrs...)
  392. # else
  393. # define HIDDEN_JUMPTARGET(name) name
  394. # endif
  395. # define hidden_def(name)
  396. # define hidden_data_def(name)
  397. # define hidden_weak(name)
  398. # define hidden_data_weak(name)
  399. #endif /* SHARED */
  400. /* uClibc does not support versioning yet. */
  401. #define versioned_symbol(lib, local, symbol, version) /* weak_alias(local, symbol) */
  402. #define hidden_ver(local, name) /* strong_alias(local, __GI_##name) */
  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_libresolv
  456. # define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  457. # define libresolv_hidden_def(name) hidden_def (name)
  458. # define libresolv_hidden_weak(name) hidden_weak (name)
  459. # define libresolv_hidden_ver(local, name) hidden_ver (local, name)
  460. # define libresolv_hidden_data_def(name) hidden_data_def (name)
  461. # define libresolv_hidden_data_weak(name) hidden_data_weak (name)
  462. # define libresolv_hidden_data_ver(local, name) hidden_data_ver (local, name)
  463. #else
  464. # define libresolv_hidden_proto(name, attrs...)
  465. # define libresolv_hidden_def(name)
  466. # define libresolv_hidden_weak(name)
  467. # define libresolv_hidden_ver(local, name)
  468. # define libresolv_hidden_data_def(name)
  469. # define libresolv_hidden_data_weak(name)
  470. # define libresolv_hidden_data_ver(local, name)
  471. #endif
  472. #if defined NOT_IN_libc && defined IS_IN_librt
  473. # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  474. # define librt_hidden_def(name) hidden_def (name)
  475. # define librt_hidden_weak(name) hidden_weak (name)
  476. # define librt_hidden_ver(local, name) hidden_ver (local, name)
  477. # define librt_hidden_data_def(name) hidden_data_def (name)
  478. # define librt_hidden_data_weak(name) hidden_data_weak (name)
  479. # define librt_hidden_data_ver(local, name) hidden_data_ver (local, name)
  480. #else
  481. # define librt_hidden_proto(name, attrs...)
  482. # define librt_hidden_def(name)
  483. # define librt_hidden_weak(name)
  484. # define librt_hidden_ver(local, name)
  485. # define librt_hidden_data_def(name)
  486. # define librt_hidden_data_weak(name)
  487. # define librt_hidden_data_ver(local, name)
  488. #endif
  489. #if defined NOT_IN_libc && defined IS_IN_libdl
  490. # define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  491. # define libdl_hidden_def(name) hidden_def (name)
  492. # define libdl_hidden_weak(name) hidden_weak (name)
  493. # define libdl_hidden_ver(local, name) hidden_ver (local, name)
  494. # define libdl_hidden_data_def(name) hidden_data_def (name)
  495. # define libdl_hidden_data_weak(name) hidden_data_weak (name)
  496. # define libdl_hidden_data_ver(local, name) hidden_data_ver (local, name)
  497. #else
  498. # define libdl_hidden_proto(name, attrs...)
  499. # define libdl_hidden_def(name)
  500. # define libdl_hidden_weak(name)
  501. # define libdl_hidden_ver(local, name)
  502. # define libdl_hidden_data_def(name)
  503. # define libdl_hidden_data_weak(name)
  504. # define libdl_hidden_data_ver(local, name)
  505. #endif
  506. #if defined NOT_IN_libc && defined IS_IN_libintl
  507. # define libintl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  508. # define libintl_hidden_def(name) hidden_def (name)
  509. # define libintl_hidden_weak(name) hidden_weak (name)
  510. # define libintl_hidden_ver(local, name) hidden_ver (local, name)
  511. # define libintl_hidden_data_def(name) hidden_data_def (name)
  512. # define libintl_hidden_data_weak(name) hidden_data_weak (name)
  513. # define libintl_hidden_data_ver(local, name) hidden_data_ver(local, name)
  514. #else
  515. # define libintl_hidden_proto(name, attrs...)
  516. # define libintl_hidden_def(name)
  517. # define libintl_hidden_weak(name)
  518. # define libintl_hidden_ver(local, name)
  519. # define libintl_hidden_data_def(name)
  520. # define libintl_hidden_data_weak(name)
  521. # define libintl_hidden_data_ver(local, name)
  522. #endif
  523. #if defined NOT_IN_libc && defined IS_IN_libnsl
  524. # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  525. # define libnsl_hidden_def(name) hidden_def (name)
  526. # define libnsl_hidden_weak(name) hidden_weak (name)
  527. # define libnsl_hidden_ver(local, name) hidden_ver (local, name)
  528. # define libnsl_hidden_data_def(name) hidden_data_def (name)
  529. # define libnsl_hidden_data_weak(name) hidden_data_weak (name)
  530. # define libnsl_hidden_data_ver(local, name) hidden_data_ver (local, name)
  531. #else
  532. # define libnsl_hidden_proto(name, attrs...)
  533. # define libnsl_hidden_def(name)
  534. # define libnsl_hidden_weak(name)
  535. # define libnsl_hidden_ver(local, name)
  536. # define libnsl_hidden_data_def(name)
  537. # define libnsl_hidden_data_weak(name)
  538. # define libnsl_hidden_data_ver(local, name)
  539. #endif
  540. #if defined NOT_IN_libc && defined IS_IN_libutil
  541. # define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  542. # define libutil_hidden_def(name) hidden_def (name)
  543. # define libutil_hidden_weak(name) hidden_weak (name)
  544. # define libutil_hidden_ver(local, name) hidden_ver (local, name)
  545. # define libutil_hidden_data_def(name) hidden_data_def (name)
  546. # define libutil_hidden_data_weak(name) hidden_data_weak (name)
  547. # define libutil_hidden_data_ver(local, name) hidden_data_ver (local, name)
  548. #else
  549. # define libutil_hidden_proto(name, attrs...)
  550. # define libutil_hidden_def(name)
  551. # define libutil_hidden_weak(name)
  552. # define libutil_hidden_ver(local, name)
  553. # define libutil_hidden_data_def(name)
  554. # define libutil_hidden_data_weak(name)
  555. # define libutil_hidden_data_ver(local, name)
  556. #endif
  557. #if defined NOT_IN_libc && defined IS_IN_libcrypt
  558. # define libcrypt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  559. # define libcrypt_hidden_def(name) hidden_def (name)
  560. # define libcrypt_hidden_weak(name) hidden_weak (name)
  561. # define libcrypt_hidden_ver(local, name) hidden_ver (local, name)
  562. # define libcrypt_hidden_data_def(name) hidden_data_def (name)
  563. # define libcrypt_hidden_data_weak(name) hidden_data_weak (name)
  564. # define libcrypt_hidden_data_ver(local, name) hidden_data_ver (local, name)
  565. #else
  566. # define libcrypt_hidden_proto(name, attrs...)
  567. # define libcrypt_hidden_def(name)
  568. # define libcrypt_hidden_weak(name)
  569. # define libcrypt_hidden_ver(local, name)
  570. # define libcrypt_hidden_data_def(name)
  571. # define libcrypt_hidden_data_weak(name)
  572. # define libcrypt_hidden_data_ver(local, name)
  573. #endif
  574. #if defined NOT_IN_libc && defined IS_IN_libpthread
  575. # define libpthread_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
  576. # define libpthread_hidden_def(name) hidden_def (name)
  577. # define libpthread_hidden_weak(name) hidden_weak (name)
  578. # define libpthread_hidden_ver(local, name) hidden_ver (local, name)
  579. # define libpthread_hidden_data_def(name) hidden_data_def (name)
  580. # define libpthread_hidden_data_weak(name) hidden_data_weak (name)
  581. # define libpthread_hidden_data_ver(local, name) hidden_data_ver (local, name)
  582. #else
  583. # define libpthread_hidden_proto(name, attrs...)
  584. # define libpthread_hidden_def(name)
  585. # define libpthread_hidden_weak(name)
  586. # define libpthread_hidden_ver(local, name)
  587. # define libpthread_hidden_data_def(name)
  588. # define libpthread_hidden_data_weak(name)
  589. # define libpthread_hidden_data_ver(local, name)
  590. #endif
  591. #endif /* _LIBC_SYMBOLS_H */