mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[kernel] Hide kernel symbols by default
Using `-fvisibility=hidden` when building the kernel, and then `--discard-all` when stripping it, we shave almost 100KiB off of the resulting ELF file. Also dropped some unused symbols from the linker script, and rearranged the sections so that the file is able to be mapped directly into memory instead of having each section copied.
This commit is contained in:
@@ -1,32 +1,32 @@
|
||||
global get_rsp
|
||||
global get_rsp: function hidden
|
||||
get_rsp:
|
||||
mov rax, rsp
|
||||
ret
|
||||
|
||||
global get_rip
|
||||
global get_rip: function hidden
|
||||
get_rip:
|
||||
pop rax ; do the same thing as 'ret', except with 'jmp'
|
||||
jmp rax ; with the return address still in rax
|
||||
|
||||
global get_caller
|
||||
global get_caller: function hidden
|
||||
get_caller:
|
||||
; No prelude - don't touch rsp or rbp
|
||||
mov rax, [rbp+8]
|
||||
ret
|
||||
|
||||
global get_grandcaller
|
||||
global get_grandcaller: function hidden
|
||||
get_grandcaller:
|
||||
; No prelude - don't touch rsp or rbp
|
||||
mov rax, [rbp]
|
||||
mov rax, [rax+8]
|
||||
ret
|
||||
|
||||
global get_gsbase
|
||||
global get_gsbase: function hidden
|
||||
get_gsbase:
|
||||
rdgsbase rax
|
||||
ret
|
||||
|
||||
global _halt
|
||||
global _halt: function hidden
|
||||
_halt:
|
||||
hlt
|
||||
jmp _halt
|
||||
|
||||
Reference in New Issue
Block a user