From a4dea4148157a94a9143dbbd92fdd88b4358676c Mon Sep 17 00:00:00 2001 From: Alexey Gavrilov Date: Sat, 20 Dec 2025 19:39:05 +0700 Subject: Global variables initialization implementation User implementation of C runtime library objects (`crti.s` and `crtn.s`) for initialization (termination functionality are ignored). Changing files order passed to the linker. Rough order is: boot.s crti.o crtbegin.o other-link-objects.o crtend.o crtn.o Signed-off-by: Alexey Gavrilov --- libgcc/x86/crti.s | 5 +++++ libgcc/x86/crtn.s | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 libgcc/x86/crti.s create mode 100644 libgcc/x86/crtn.s (limited to 'libgcc/x86') diff --git a/libgcc/x86/crti.s b/libgcc/x86/crti.s new file mode 100644 index 0000000..57cb8c1 --- /dev/null +++ b/libgcc/x86/crti.s @@ -0,0 +1,5 @@ +section .init +global _init:function +_init: + push ebp + mov ebp, esp diff --git a/libgcc/x86/crtn.s b/libgcc/x86/crtn.s new file mode 100644 index 0000000..537fa65 --- /dev/null +++ b/libgcc/x86/crtn.s @@ -0,0 +1,3 @@ +section .init + pop ebp + ret -- cgit v1.2.3