implement our own malloc/free, finally drop libc

This commit is contained in:
2026-03-12 10:02:51 +01:00
parent 3fdf7bb99d
commit 1e7657ea2a
4 changed files with 139 additions and 91 deletions

View File

@@ -106,6 +106,20 @@ impl<'a> CodegenX86_64<'a> {
"section .note.GNU-stack
db 0
section .bss
_heap_head: resq 1
_heap_tail: resq 1
section .text._builtin_heap_head
_builtin_heap_head:
lea rax, [rel _heap_head]
ret
section .text._builtin_heap_tail
_builtin_heap_tail:
lea rax, [rel _heap_tail]
ret
section .text._builtin_read64
_builtin_read64:
mov rax, qword [rdi]