mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-07 06:53:33 +00:00
Remove superfluous RET instructions
This commit is contained in:
parent
b6182db813
commit
9793d3524f
3 changed files with 9 additions and 11 deletions
|
@ -23,9 +23,8 @@ ftrace_hook:
|
|||
#ifdef __x86_64__
|
||||
|
||||
cmp $0,__ftrace(%rip)
|
||||
jg 1f
|
||||
ret
|
||||
1: push %rbp
|
||||
jle 1f
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
push %rax
|
||||
push %rax
|
||||
|
@ -45,16 +44,15 @@ ftrace_hook:
|
|||
pop %rax
|
||||
pop %rax
|
||||
pop %rbp
|
||||
ret
|
||||
1: ret
|
||||
|
||||
#elif defined(__aarch64__)
|
||||
|
||||
adrp x9,__ftrace
|
||||
ldr w9,[x9,#:lo12:__ftrace]
|
||||
cmp w9,1
|
||||
bge 1f
|
||||
ret
|
||||
1: stp x29,x30,[sp,-96]!
|
||||
cmp w9,0
|
||||
ble 1f
|
||||
stp x29,x30,[sp,-96]!
|
||||
mov x29,sp
|
||||
stp x0,x1,[sp,16]
|
||||
stp x2,x3,[sp,32]
|
||||
|
@ -68,7 +66,7 @@ ftrace_hook:
|
|||
ldp x2,x3,[sp,32]
|
||||
ldp x0,x1,[sp,16]
|
||||
ldp x29,x30,[sp],96
|
||||
ret
|
||||
1: ret
|
||||
|
||||
#endif /* __x86_64__ */
|
||||
.endfn ftrace_hook,globl
|
||||
|
|
|
@ -48,9 +48,7 @@
|
|||
.section .initprologue,"ax",@progbits
|
||||
.type _init,@function
|
||||
.globl _init
|
||||
.ftrace1
|
||||
_init:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
|
|
|
@ -68,6 +68,7 @@
|
|||
"__builtin_ctzl"
|
||||
"__builtin_ctzll"
|
||||
"__builtin_expect"
|
||||
"__builtin_memcpy"
|
||||
"__builtin_expect_with_probability"
|
||||
"__builtin_extract_return_addr"
|
||||
"__builtin_isnan"
|
||||
|
@ -97,6 +98,7 @@
|
|||
"__builtin_trap"
|
||||
"__builtin_types_compatible_p"
|
||||
"__builtin_unreachable"
|
||||
"__builtin_ia32_movntdq"
|
||||
"__has_attribute"
|
||||
"__has_builtin"
|
||||
"__has_cpp_attribute"
|
||||
|
|
Loading…
Reference in a new issue