xref: /DragonStub/lib/ctors.S (revision 97499a0cf265bf2d515bfcab99349ce00ecf2662)
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
14_init_array:
15	.p2align 3, 0
16	.globl _init_array_end
17_init_array_end:
18	.long 0
19	.section .ctors, "aw", @progbits
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, "aw", @progbits
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, "aw", @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
44#if defined(__ELF__) && defined(__linux__)
45	.section .note.GNU-stack,"",%progbits
46#endif
47
48