History log of /DragonStub/lib/init.c (Results 1 – 7 of 7)
Revision Date Author Comments
# 3e6106c4 30-Nov-2023 LoGin <longjin@DragonOS.org>

引入libfdt并进行平台特性检测 (#6)


# 78b790fa 28-Nov-2023 LoGin <longjin@DragonOS.org>

完善命令行参数解析 (#4)


# f412fd2a 28-Nov-2023 LoGin <longjin@DragonOS.org>

命令行参数解析 (#3)

* 命令行参数解析


# 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 ...


# b1d426ce 06-Nov-2017 Nigel Croxon <ncroxon@redhat.com>

Move memcpy/memset definition to global init.c

Following up on previous patch, I think we should move
memcpy/memset definitions to the global init.c, since MSVC does
also inserts calls to memset/mem

Move memcpy/memset definition to global init.c

Following up on previous patch, I think we should move
memcpy/memset definitions to the global init.c, since MSVC does
also inserts calls to memset/memcpy for the x86_32 platform,
even when disabling standard libraries and intrinsics.

All in all, it looks like, for all platforms, we should assume
that a compiler may still insert these calls regardless.

Signed-off-by: Pete Batard <pete@akeo.ie>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>

show more ...


# 3f8935c3 17-Feb-2017 Nigel Croxon <ncroxon@redhat.com>

add-Exit - Add Exit() library function which calls BS->Exit()

Signed-off-by: Jonathon Reinhart <jonathon.reinhart@gmail.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>


# 530d68ba 25-Nov-2014 Nigel Croxon <nigel.croxon@hp.com>

The gnu-efi-3.0 toplevel subdirectory is really annoying. Kill it.

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hp.com>