elf-embed.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* Target macros for riscv*-elf targets.
  2. Copyright (C) 1994-2017 Free Software Foundation, Inc.
  3. This file is part of GCC.
  4. GCC is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3, or (at your option)
  7. any later version.
  8. GCC is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GCC; see the file COPYING3. If not see
  14. <http://www.gnu.org/licenses/>. */
  15. #define LINK_SPEC "\
  16. -melf" XLEN_SPEC "lriscv \
  17. %{mno-relax:--no-relax} \
  18. %{shared}"
  19. /* Link against Newlib libraries, because the ELF backend assumes Newlib.
  20. Handle the circular dependence between libc and libgloss. */
  21. #undef LIB_SPEC
  22. // GNU MCU Eclipse
  23. // #define LIB_SPEC "--start-group -lc %{!specs=nosys.specs:-lgloss} --end-group"
  24. // The sequence is copied from arm-none-eabi, might not be exactly right.
  25. #define LIB_SPEC "--start-group -lgcc -lg -lc --end-group"
  26. #undef STARTFILE_SPEC
  27. #define STARTFILE_SPEC "crt0%O%s crtbegin%O%s"
  28. #undef ENDFILE_SPEC
  29. #define ENDFILE_SPEC "crtend%O%s"
  30. #define NO_IMPLICIT_EXTERN_C 1