crti.S 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* Special .init and .fini section support for tile.
  2. Copyright (C) 2012-2018 Free Software Foundation, Inc.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. In addition to the permissions in the GNU Lesser General Public
  8. License, the Free Software Foundation gives you unlimited
  9. permission to link the compiled version of this file with other
  10. programs, and to distribute those programs without any restriction
  11. coming from the use of this file. (The GNU Lesser General Public
  12. License restrictions do apply in other respects; for example, they
  13. cover modification of the file, and distribution when not linked
  14. into another program.)
  15. Note that people who make modified versions of this file are not
  16. obligated to grant this special exception for their modified
  17. versions; it is their choice whether to do so. The GNU Lesser
  18. General Public License gives permission to release a modified
  19. version without this exception; this exception also makes it
  20. possible to release a modified version which carries forward this
  21. exception.
  22. The GNU C Library is distributed in the hope that it will be useful,
  23. but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  25. Lesser General Public License for more details.
  26. You should have received a copy of the GNU Lesser General Public
  27. License along with the GNU C Library; if not, see
  28. <http://www.gnu.org/licenses/>. */
  29. /* crti.S puts a function prologue at the beginning of the .init and
  30. .fini sections and defines global symbols for those addresses, so
  31. they can be called as functions. The symbols _init and _fini are
  32. magic and cause the linker to emit DT_INIT and DT_FINI. */
  33. #include <sysdep.h>
  34. .section .init,"ax",@progbits
  35. .align 8
  36. .globl _init
  37. .type _init, @function
  38. _init:
  39. {
  40. move r29, sp
  41. ADDI_PTR r28, sp, -REGSIZE
  42. st sp, lr
  43. }
  44. ADDI_PTR sp, sp, -(2 * REGSIZE)
  45. st r28, r29
  46. .Lno_weak_fn:
  47. .section .fini,"ax",@progbits
  48. .align 8
  49. .globl _fini
  50. .type _fini, @function
  51. _fini:
  52. {
  53. move r29, sp
  54. ADDI_PTR r28, sp, -REGSIZE
  55. st sp, lr
  56. }
  57. ADDI_PTR sp, sp, -(2 * REGSIZE)
  58. st r28, r29