Fix --ftrace with cosmo_dlopen()

This change ensures function call logging won't crash the process when
cosmo_dlopen() is called.
This commit is contained in:
Justine Tunney 2024-01-05 15:11:37 -08:00
parent 15548b523c
commit 2d93788ce3
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
8 changed files with 35 additions and 7 deletions

View file

@ -1,2 +0,0 @@
#include "libc/sysv/macros.internal.h"
.scall sys_set_tls,0x13d1490a5300309e,4095,3,165,globl,hidden

View file

@ -1725,6 +1725,7 @@ syscon nr __NR_ioperm 0x00ad 0x0fff 0xfff 0xfff 0xfff 0xfff 0xfff
syscon nr __NR_init_module 0x00af 0x0069 0xfff 0xfff 0xfff 0xfff 0xfff 0xfff
syscon nr __NR_delete_module 0x00b0 0x006a 0xfff 0xfff 0xfff 0xfff 0xfff 0xfff
syscon nr __NR_gettid 0x00ba 0x00b2 0x100001b 0xfff 432 299 311 0xfff # TODO(jart): thread_self_trap vs. gettid?
syscon nr __NR_set_tls 0x009e 0xfff 0x3000003 0xfff 0x00a5 0x0149 0x13d 0xfff
syscon nr __NR_readahead 0x00bb 0x00d5 0xfff 0xfff 0xfff 0xfff 0xfff 0xfff
syscon nr __NR_setxattr 0x00bc 0x0005 0x20000ec 0x00ec 0xfff 0xfff 0x177 0xfff
syscon nr __NR_fsetxattr 0x00be 0x0007 0x20000ed 0x00ed 0xfff 0xfff 0x179 0xfff

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon nr,__NR_set_tls,0x009e,0xfff,0x3000003,0xfff,0x00a5,0x0149,0x13d,0xfff

View file

@ -201,7 +201,6 @@ scall sys_modify_ldt 0xfffffffffffff09a 0xfff globl # no wrapper
scall sys_pivot_root 0xfffffffffffff09b 0x029 globl hidden
#scall prctl 0xfffffffffffff09d 0x0a7 globl # wrapped manually
scall sys_arch_prctl 0x0a50a50a5ffff09e 0xfff globl hidden # sysarch() on bsd
scall sys_set_tls 0x13d1490a5300309e 0xfff globl hidden # arch_prctl on linux, sysarch on freebsd, _lwp_setprivate on netbsd, __set_tcb on openbsd, _lwp_setprivate on netbsd, thread_fast_set_cthread_self on xnu
scall sys_adjtimex 0xfffffffffffff09f 0x0ab globl # no wrapper
scall sys_swapon 0xffffff05520550a7 0x0e0 globl # no wrapper
scall sys_swapoff 0xffffff1a8ffff0a8 0x0e1 globl # no wrapper