ctors.S 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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,"aw",%init_array
  12. .p2align 3, 0
  13. .globl __init_array_start
  14. __init_array_start:
  15. .p2align 3, 0
  16. .globl __init_array_end
  17. __init_array_end:
  18. .section .ctors,"aw",%progbits
  19. .p2align 3, 0
  20. .globl __CTOR_LIST__
  21. __CTOR_LIST__:
  22. .p2align 3, 0
  23. .globl __CTOR_END__
  24. __CTOR_END__:
  25. .section .dtors,"aw",%progbits
  26. .p2align 3, 0
  27. .globl __DTOR_LIST__
  28. __DTOR_LIST__:
  29. .p2align 3, 0
  30. .globl __DTOR_END__
  31. __DTOR_END__:
  32. .section .fini_array,"aw",%fini_array
  33. .p2align 3, 0
  34. .globl __fini_array_start
  35. __fini_array_start:
  36. .p2align 3, 0
  37. .globl __fini_array_end
  38. __fini_array_end:
  39. .p2align 3, 0
  40. #if defined(__ELF__) && defined(__linux__)
  41. .section .note.GNU-stack,"",%progbits
  42. #endif