uclinux-elf.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* Definitions for TI C6X running ucLinux using ELF
  2. Copyright (C) 2010-2015 Free Software Foundation, Inc.
  3. Contributed by Andrew Jenner <andrew@codesourcery.com>
  4. Contributed by Bernd Schmidt <bernds@codesourcery.com>
  5. This file is part of GCC.
  6. GCC is free software; you can redistribute it and/or modify it
  7. under the terms of the GNU General Public License as published
  8. by the Free Software Foundation; either version 3, or (at your
  9. option) any later version.
  10. GCC is distributed in the hope that it will be useful, but WITHOUT
  11. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  12. or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  13. License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with GCC; see the file COPYING3. If not see
  16. <http://www.gnu.org/licenses/>. */
  17. #undef TARGET_OS_CPP_BUILTINS
  18. #define TARGET_OS_CPP_BUILTINS() \
  19. do \
  20. { \
  21. builtin_define ("__uClinux__"); \
  22. builtin_define_std ("linux"); \
  23. builtin_define_std ("unix"); \
  24. builtin_assert ("system=linux"); \
  25. builtin_assert ("system=unix"); \
  26. builtin_assert ("system=posix"); \
  27. } \
  28. while (false)
  29. #undef STARTFILE_SPEC
  30. #define STARTFILE_SPEC \
  31. "%{!shared:crt1%O%s} crti%O%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
  32. #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
  33. #undef LINK_SPEC
  34. #define LINK_SPEC ENDIAN_LINK_SPEC \
  35. "%{shared} %{fpie|fPIE:-pie} \
  36. %{!shared: %{!static: \
  37. %{rdynamic:-export-dynamic} \
  38. %{!dynamic-linker:-dynamic-linker " UCLIBC_DYNAMIC_LINKER "}} \
  39. %{static}}"
  40. #undef DRIVER_SELF_SPECS
  41. #define DRIVER_SELF_SPECS "%{!mno-dsbt:-mdsbt}"
  42. /* Clear the instruction cache from `beg' to `end'. This makes an
  43. inline system call to SYS_cacheflush. */
  44. #undef CLEAR_INSN_CACHE
  45. #define CLEAR_INSN_CACHE(BEG, END) \
  46. { \
  47. register unsigned long _beg __asm ("A4") = (unsigned long) (BEG); \
  48. register unsigned long _end __asm ("B4") = (unsigned long) (END); \
  49. register unsigned long _scno __asm ("B0") = 244; \
  50. __asm __volatile ("swe ; sys_cache_sync" \
  51. : "=a" (_beg) \
  52. : "0" (_beg), "b" (_end), "b" (_scno)); \
  53. }