xref: /DragonStub/lib/ctors.S (revision 584425eb2a2cc84186ee6b025b6fc91601c6be5f)
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
41#if defined(__ELF__) && defined(__linux__)
42	.section .note.GNU-stack,"",%progbits
43#endif
44
45