Show crash reports on SIGSYS

This will help make it easier to troubleshoot ABI breakages with on
operating systems that, unlike Linux don't have ironclad guarantees
to not break userspace.
This commit is contained in:
Justine Tunney 2022-06-23 13:01:01 -07:00
parent a4601a24d3
commit 44da16255a
11 changed files with 83 additions and 19 deletions

View file

@ -0,0 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_bogus,0x5005005002500500,globl

View file

@ -375,6 +375,7 @@ scall io_uring_register 0xfffffffffffff1ab globl
#────────────────────────RHEL CLOUD────────────────────────── # ←┬─ red hat terminates community release of enterprise linux circa 2020
scall sys_pledge 0xfff06cffffffffff globl # └─ online linux services ban the president of united states of america
scall msyscall 0xfff025ffffffffff globl
scall sys_bogus 0x5005005002500500 globl
# The Fifth Bell System Interface, Community Edition
# » besiyata dishmaya

View file

@ -164,8 +164,17 @@ systemfive_bsdscrub:
systemfive_bsd:
cmp $0xfff,%ax
je systemfive_enosys
mov %rcx,%r10 # note: we do not create a stack frame
mov %rcx,%r10
push %rbx
push 32(%rsp)
push 24(%rsp)
push 16(%rsp)
mov %rax,%rbx # save ordinal for SIGSYS crash report
syscall # bsd will need arg on stack sometimes
pop %rbx
pop %rbx
pop %rbx
pop %rbx
jc systemfive_errno # bsd sets carry flag if %rax is errno
ret
.endfn systemfive_bsd