History log of /DragonStub/lib/ctors.S (Results 1 – 7 of 7)
Revision Date Author Comments
# 67762bdb 23-May-2023 b'Nigel Croxon <allura@localhost>

Merge /u/gmbr3/gnu-efi/ branch ia32 into master

https://sourceforge.net/p/gnu-efi/code/merge-requests/54/


# 584425eb 23-May-2023 Callum Farmer <gmbr3@opensuse.org>

ctors.S: Fix section definitions

Using @ doesn't work on ARM32

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>


# 9835e11e 16-May-2023 b'Nigel Croxon <allura@localhost>

Merge /u/gmbr3/gnu-efi/ branch ia32 into master

https://sourceforge.net/p/gnu-efi/code/merge-requests/51/


# 7dac1844 06-May-2023 Callum Farmer <gmbr3@opensuse.org>

Re-write entry.c/ctors.S to work better

* Make entry.c work correctly in reverse order
* Remove incorrectly sized (on non-32bit) NULLs from ctors.S

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>


# 9c5403e1 30-Apr-2023 Callum Farmer <gmbr3@opensuse.org>

Copy marker names from binutils for init/fini

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>


# 97499a0c 26-Apr-2023 Callum Farmer <gmbr3@opensuse.org>

ctors.S: Use LSB defined section perms

Seems to not be correct at the moment, causes errors.

error: expected the entry size
.section .fini_array, "aM", @fini_array

Change per
https://refspecs.linu

ctors.S: Use LSB defined section perms

Seems to not be correct at the moment, causes errors.

error: expected the entry size
.section .fini_array, "aM", @fini_array

Change per
https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/specialsections.html

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>

show more ...


# 4f8b339f 28-Mar-2023 Peter Jones <pjones@redhat.com>

Make ELF constructors and destructors work

This makes setup and teardown functions defined with
__attribute__((__constructor__) and __attribute__((__destructor__)) work
in normal circumstances in EF

Make ELF constructors and destructors work

This makes setup and teardown functions defined with
__attribute__((__constructor__) and __attribute__((__destructor__)) work
in normal circumstances in EFI binaries.

A couple of notes:
- it implements both the old-style .ctors/.dtors methods and the newer
style .init_array/.fini_array ELF constructor and destructor arrays,
processed in the order:
.init_array[]
.ctors[]
efi_main()
.dtors[]
.fini_array[]
- Destructors will only be called if efi_main() exits using "return";
any call to Exit() will still longjmp() past them.
- InitializeLib() has already been called before constructors run, so
they don't need to call it (and neither does anything else.) For
compatibility, it has been altered so calling it more than once is
safe.
- No attempt is made to handle any constructor or destructor with a
prototype other than "void func(void);", but note that InitializeLib
has been called, so LibImageHandle, ST, BS, and RT are set.
- The init_array/ctor/dtor/fini_array lists aren't the using the GNU
"CONSTRUCTOR" output section command, so they don't start with a size.
- The lists are individually sorted during the link stage via
SORT_BY_NAME() in the linker script.
- The default (empty) init_array/ctor/dtor/fini_array lists are padded
out to 8-byte alignment with ".p2align 3, 0", and each list always has
at least one ".long 0" at the end of it (even if it's completely
empty). As a result, they can have NULLs that need to be skipped.
The sections they're in are mergeable, so the NULLs don't have to be
exclusively at the end.
- The ia64 and mips64el arches have not been tested.

Signed-off-by: Peter Jones <pjones@redhat.com>

show more ...