aeabi_lcsts.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* Link-time constants for ARM EABI.
  2. Copyright (C) 2005 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. In addition to the permissions in the GNU Lesser General Public
  9. License, the Free Software Foundation gives you unlimited
  10. permission to link the compiled version of this file with other
  11. programs, and to distribute those programs without any restriction
  12. coming from the use of this file. (The GNU Lesser General Public
  13. License restrictions do apply in other respects; for example, they
  14. cover modification of the file, and distribution when not linked
  15. into another program.)
  16. Note that people who make modified versions of this file are not
  17. obligated to grant this special exception for their modified
  18. versions; it is their choice whether to do so. The GNU Lesser
  19. General Public License gives permission to release a modified
  20. version without this exception; this exception also makes it
  21. possible to release a modified version which carries forward this
  22. exception.
  23. The GNU C Library is distributed in the hope that it will be useful,
  24. but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  26. Lesser General Public License for more details.
  27. You should have received a copy of the GNU Lesser General Public
  28. License along with the GNU C Library; if not, see
  29. <http://www.gnu.org/licenses/>. */
  30. /* The ARM EABI requires that we provide ISO compile-time constants as
  31. link-time constants. Some portable applications may reference these. */
  32. #include <errno.h>
  33. #include <limits.h>
  34. #include <locale.h>
  35. #include <setjmp.h>
  36. #include <signal.h>
  37. #include <stdio.h>
  38. #include <time.h>
  39. #define eabi_constant2(X,Y) const int __aeabi_##X attribute_hidden = Y
  40. #define eabi_constant(X) const int __aeabi_##X attribute_hidden = X
  41. eabi_constant (EDOM);
  42. eabi_constant (ERANGE);
  43. eabi_constant (EILSEQ);
  44. eabi_constant (MB_LEN_MAX);
  45. eabi_constant (LC_COLLATE);
  46. eabi_constant (LC_CTYPE);
  47. eabi_constant (LC_MONETARY);
  48. eabi_constant (LC_NUMERIC);
  49. eabi_constant (LC_TIME);
  50. eabi_constant (LC_ALL);
  51. /* The value of __aeabi_JMP_BUF_SIZE is the number of doublewords in a
  52. jmp_buf. */
  53. eabi_constant2 (JMP_BUF_SIZE, sizeof (jmp_buf) / 8);
  54. eabi_constant (SIGABRT);
  55. eabi_constant (SIGFPE);
  56. eabi_constant (SIGILL);
  57. eabi_constant (SIGINT);
  58. eabi_constant (SIGSEGV);
  59. eabi_constant (SIGTERM);
  60. eabi_constant2 (IOFBF, _IOFBF);
  61. eabi_constant2 (IOLBF, _IOLBF);
  62. eabi_constant2 (IONBF, _IONBF);
  63. eabi_constant (BUFSIZ);
  64. eabi_constant (FOPEN_MAX);
  65. eabi_constant (TMP_MAX);
  66. eabi_constant (FILENAME_MAX);
  67. #ifdef __UCLIBC_SUSV4_LEGACY__
  68. eabi_constant (L_tmpnam);
  69. #endif
  70. FILE *__aeabi_stdin attribute_hidden;
  71. FILE *__aeabi_stdout attribute_hidden;
  72. FILE *__aeabi_stderr attribute_hidden;
  73. static void __attribute__ ((used))
  74. setup_aeabi_stdio (void)
  75. {
  76. __aeabi_stdin = stdin;
  77. __aeabi_stdout = stdout;
  78. __aeabi_stderr = stderr;
  79. }
  80. static void (*fp) (void) __attribute__ ((used, section (".preinit_array")))
  81. = setup_aeabi_stdio;
  82. eabi_constant (CLOCKS_PER_SEC);