gnu-efi/lib/ctors.S
2021-02-19 17:38:07 -05:00

48 lines
1.1 KiB
ArmAsm

/*
* Try to define the minimal empty init/ctor/dtor/fini_arrays so building with
* older or out-of-tree linker scripts will still work.
*/
/*
* Note that these aren't the using the GNU "CONSTRUCTOR" output section
* command, so they don't start with a size. Because of p2align and the
* end/END definitions, and the fact that they're mergeable, they can also
* have NULLs which aren't guaranteed to be at the end.
*/
#ifdef __ARMEL__
#define ARCH_SECTION(x) % ## x
#else
#define ARCH_SECTION(x) @ ## x
#endif
.section .init_array, "a", ARCH_SECTION(init_array)
.p2align 3, 0
.globl _init_array
_init_array:
.p2align 3, 0
.globl _init_array_end
_init_array_end:
.8byte 0
.section .ctors, "a", ARCH_SECTION(init_array)
.p2align 3, 0
.globl __CTOR_LIST__
__CTOR_LIST__:
.p2align 3, 0
.globl __CTOR_END__
__CTOR_END__:
.8byte 0
.section .dtors, "a", ARCH_SECTION(fini_array)
.p2align 3, 0
.globl __DTOR_LIST__
__DTOR_LIST__:
.p2align 3, 0
.globl __DTOR_END__
__DTOR_END__:
.8byte 0
.section .fini_array, "a", ARCH_SECTION(fini_array)
.p2align 3, 0
.globl _fini_array
_fini_array:
.p2align 3, 0
.globl _fini_array_end
_fini_array_end:
.8byte 0