mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 16:47:34 +00:00
LibC: Use our implementation of crti.o
and crtn.o
We have had these for quite a while, but we didn't compile them, and used GCC's version instead. Clang does not come with these, so we have to provide our own implementation. Our implementation follows what `musl` and `FreeBSD` do, so this should work fine, even if documentation can hardly be found for them.
This commit is contained in:
parent
7f2eb2f332
commit
a88f7c99fe
8 changed files with 93 additions and 35 deletions
23
Userland/Libraries/LibC/arch/i386/crti.S
Normal file
23
Userland/Libraries/LibC/arch/i386/crti.S
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
.section .init, "ax", @progbits
|
||||
.align 4
|
||||
.global _init
|
||||
.type _init, @function
|
||||
_init:
|
||||
pushl %ebp
|
||||
movl %esp, %ebp
|
||||
andl $-16, %esp
|
||||
|
||||
.section .fini, "ax", @progbits
|
||||
.align 4
|
||||
.global _fini
|
||||
.type _fini, @function
|
||||
_fini:
|
||||
pushl %ebp
|
||||
movl %esp, %ebp
|
||||
andl $-16, %esp
|
15
Userland/Libraries/LibC/arch/i386/crtn.S
Normal file
15
Userland/Libraries/LibC/arch/i386/crtn.S
Normal file
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
.section .init, "ax", @progbits
|
||||
movl %ebp, %esp
|
||||
popl %ebp
|
||||
retl
|
||||
|
||||
.section .fini, "ax", @progbits
|
||||
movl %ebp, %esp
|
||||
popl %ebp
|
||||
retl
|
Loading…
Add table
Add a link
Reference in a new issue