aeabi_lcsts.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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, write to the Free
  29. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  30. 02111-1307 USA. */
  31. /* The ARM EABI requires that we provide ISO compile-time constants as
  32. link-time constants. Some portable applications may reference these. */
  33. #include <errno.h>
  34. #include <limits.h>
  35. #include <locale.h>
  36. #include <setjmp.h>
  37. #include <signal.h>
  38. #include <stdio.h>
  39. #include <time.h>
  40. #define eabi_constant2(X,Y) const int __aeabi_##X attribute_hidden = Y
  41. #define eabi_constant(X) const int __aeabi_##X attribute_hidden = X
  42. eabi_constant (EDOM);
  43. eabi_constant (ERANGE);
  44. eabi_constant (EILSEQ);
  45. eabi_constant (MB_LEN_MAX);
  46. eabi_constant (LC_COLLATE);
  47. eabi_constant (LC_CTYPE);
  48. eabi_constant (LC_MONETARY);
  49. eabi_constant (LC_NUMERIC);
  50. eabi_constant (LC_TIME);
  51. eabi_constant (LC_ALL);
  52. /* The value of __aeabi_JMP_BUF_SIZE is the number of doublewords in a
  53. jmp_buf. */
  54. eabi_constant2 (JMP_BUF_SIZE, sizeof (jmp_buf) / 8);
  55. eabi_constant (SIGABRT);
  56. eabi_constant (SIGFPE);
  57. eabi_constant (SIGILL);
  58. eabi_constant (SIGINT);
  59. eabi_constant (SIGSEGV);
  60. eabi_constant (SIGTERM);
  61. eabi_constant2 (IOFBF, _IOFBF);
  62. eabi_constant2 (IOLBF, _IOLBF);
  63. eabi_constant2 (IONBF, _IONBF);
  64. eabi_constant (BUFSIZ);
  65. eabi_constant (FOPEN_MAX);
  66. eabi_constant (TMP_MAX);
  67. eabi_constant (FILENAME_MAX);
  68. eabi_constant (L_tmpnam);
  69. FILE *__aeabi_stdin attribute_hidden;
  70. FILE *__aeabi_stdout attribute_hidden;
  71. FILE *__aeabi_stderr attribute_hidden;
  72. static void __attribute__ ((used))
  73. setup_aeabi_stdio (void)
  74. {
  75. __aeabi_stdin = stdin;
  76. __aeabi_stdout = stdout;
  77. __aeabi_stderr = stderr;
  78. }
  79. static void (*fp) (void) __attribute__ ((used, section (".preinit_array")))
  80. = setup_aeabi_stdio;
  81. eabi_constant (CLOCKS_PER_SEC);