ctors.S 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Try to define the minimal empty init/ctor/dtor/fini_arrays so building with
  3. * older or out-of-tree linker scripts will still work.
  4. */
  5. /*
  6. * Note that these aren't the using the GNU "CONSTRUCTOR" output section
  7. * command, so they don't start with a size. Because of p2align and the
  8. * end/END definitions, and the fact that they're mergeable, they can also
  9. * have NULLs which aren't guaranteed to be at the end.
  10. */
  11. .section .init_array, "aM", @init_array
  12. .p2align 3, 0
  13. .globl _init_array
  14. _init_array:
  15. .p2align 3, 0
  16. .globl _init_array_end
  17. _init_array_end:
  18. .long 0
  19. .section .ctors, "aM", @init_array
  20. .p2align 3, 0
  21. .globl __CTOR_LIST__
  22. __CTOR_LIST__:
  23. .p2align 3, 0
  24. .globl __CTOR_END__
  25. __CTOR_END__:
  26. .long 0
  27. .section .dtors, "aM", @fini_array
  28. .p2align 3, 0
  29. .globl __DTOR_LIST__
  30. __DTOR_LIST__:
  31. .p2align 3, 0
  32. .globl __DTOR_END__
  33. __DTOR_END__:
  34. .long 0
  35. .section .fini_array, "aM", @fini_array
  36. .p2align 3, 0
  37. .globl _fini_array
  38. _fini_array:
  39. .p2align 3, 0
  40. .globl _fini_array_end
  41. _fini_array_end:
  42. .long 0
  43. #if defined(__ELF__) && defined(__linux__)
  44. .section .note.GNU-stack,"",%progbits
  45. #endif