sys: add ld runtime linker

This commit is contained in:
2026-02-19 19:30:07 +00:00
parent 1e6748b4fc
commit efad96ce63
5 changed files with 83 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
ENTRY(_start)
SECTIONS {
.text ALIGN(4K) : {
*(.text)
*(.rodata)
}
.rodata ALIGN(4K) : {
}
.data ALIGN(4K) : {
*(.data)
*(.bss)
*(.dynamic)
}
.dynamic ALIGN(8) : {
*(.dynamic)
}
.got.plt ALIGN(4K) : {
*(.got.plt)
}
/DISCARD/ : {
*(.interp)
}
}

View File

@@ -0,0 +1,15 @@
.code64
.global _start
.type _start, @function
.extern main
.type main, @function
.extern exit
.type exit, @function
_start:
call main
1: pause
jmp 1b