frvend.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* Frv initialization file linked after all user modules
  2. Copyright (C) 1999-2022 Free Software Foundation, Inc.
  3. Contributed by Red Hat, Inc.
  4. This file is part of GCC.
  5. GCC is free software ; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3, or (at your option)
  8. any later version.
  9. GCC is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY ; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. Under Section 7 of GPL version 3, you are granted additional
  14. permissions described in the GCC Runtime Library Exception, version
  15. 3.1, as published by the Free Software Foundation.
  16. You should have received a copy of the GNU General Public License and
  17. a copy of the GCC Runtime Library Exception along with this program;
  18. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  19. <http://www.gnu.org/licenses/>. */
  20. #include <stddef.h>
  21. #include "../libgcc/unwind-dw2-fde.h"
  22. #ifdef __FRV_UNDERSCORE__
  23. #define UNDERSCORE "_"
  24. #else
  25. #define UNDERSCORE ""
  26. #endif
  27. #define FINI_SECTION_ZERO(SECTION, FLAGS, NAME) \
  28. __asm__ (".section " SECTION "," FLAGS "\n\t" \
  29. ".globl " UNDERSCORE NAME "\n\t" \
  30. ".type " UNDERSCORE NAME ",@object\n\t" \
  31. ".p2align 2\n" \
  32. UNDERSCORE NAME ":\n\t" \
  33. ".word 0\n\t" \
  34. ".previous")
  35. #define FINI_SECTION(SECTION, FLAGS, NAME) \
  36. __asm__ (".section " SECTION "," FLAGS "\n\t" \
  37. ".globl " UNDERSCORE NAME "\n\t" \
  38. ".type " UNDERSCORE NAME ",@object\n\t" \
  39. ".p2align 2\n" \
  40. UNDERSCORE NAME ":\n\t" \
  41. ".previous")
  42. /* End of .ctor/.dtor sections that provides a list of constructors and
  43. destructors to run. */
  44. FINI_SECTION_ZERO (".ctors", "\"a\"", "__CTOR_END__");
  45. FINI_SECTION_ZERO (".dtors", "\"a\"", "__DTOR_END__");
  46. /* End of .eh_frame section that provides all of the exception handling
  47. tables. */
  48. FINI_SECTION_ZERO (".eh_frame", "\"aw\"", "__FRAME_END__");
  49. #if ! __FRV_FDPIC__
  50. /* In FDPIC, the linker itself generates this. */
  51. /* End of .rofixup section that provides a list of pointers that we
  52. need to adjust. */
  53. FINI_SECTION (".rofixup", "\"a\"", "__ROFIXUP_END__");
  54. #endif /* __FRV_FDPIC__ */