crtn.S 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* Copyright (C) 2001-2022 Free Software Foundation, Inc.
  2. This file is part of GCC.
  3. GCC is free software; you can redistribute it and/or modify it under
  4. the terms of the GNU General Public License as published by the Free
  5. Software Foundation; either version 3, or (at your option) any later
  6. version.
  7. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  8. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  9. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  10. for more details.
  11. Under Section 7 of GPL version 3, you are granted additional
  12. permissions described in the GCC Runtime Library Exception, version
  13. 3.1, as published by the Free Software Foundation.
  14. You should have received a copy of the GNU General Public License and
  15. a copy of the GCC Runtime Library Exception along with this program;
  16. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  17. <http://www.gnu.org/licenses/>. */
  18. /* An executable stack is *not* required for these functions. */
  19. #include "gnustack.h"
  20. /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack.
  21. Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */
  22. #ifdef __mips16
  23. #define RA $7
  24. #else
  25. #define RA $31
  26. #endif
  27. .section .init,"ax",@progbits
  28. init:
  29. #ifdef __mips64
  30. ld RA,40($sp)
  31. daddu $sp,$sp,48
  32. #else
  33. lw RA,20($sp)
  34. addu $sp,$sp,32
  35. #endif
  36. j RA
  37. .section .fini,"ax",@progbits
  38. fini:
  39. #ifdef __mips64
  40. ld RA,40($sp)
  41. daddu $sp,$sp,48
  42. #else
  43. lw RA,20($sp)
  44. addu $sp,$sp,32
  45. #endif
  46. j RA