Remove sv_prepsyscall, sv_sigsize and sv_sigtbl members of the struct
sysent. sv_prepsyscall is unused. sv_sigsize and sv_sigtbl translate signal number from the FreeBSD namespace into the ABI domain. It is only utilized on i386 for iBCS2 binaries. The issue with this approach is that signals for iBCS2 were delivered with the FreeBSD signal frame layout, which does not follow iBCS2. The same note is true for any other potential user if sv_sigtbl. In other words, if ABI needs signal number translation, it really needs custom sv_sendsig method instead. Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
01e10e7a39
commit
ee461b4bba
@ -51,8 +51,6 @@ struct sysentvec elf64_freebsd_sysvec = {
|
||||
.sv_size = SYS_MAXSYSCALL,
|
||||
.sv_table = sysent,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = 0,
|
||||
.sv_errtbl = NULL,
|
||||
.sv_transtrap = NULL,
|
||||
@ -60,7 +58,6 @@ struct sysentvec elf64_freebsd_sysvec = {
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = sigcode,
|
||||
.sv_szsigcode = &szsigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD ELF64",
|
||||
.sv_coredump = __elfN(coredump),
|
||||
.sv_imgact_try = NULL,
|
||||
|
@ -750,8 +750,6 @@ struct sysentvec elf_linux_sysvec = {
|
||||
.sv_size = LINUX_SYS_MAXSYSCALL,
|
||||
.sv_table = linux_sysent,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = ELAST + 1,
|
||||
.sv_errtbl = bsd_to_linux_errno,
|
||||
.sv_transtrap = translate_traps,
|
||||
@ -759,7 +757,6 @@ struct sysentvec elf_linux_sysvec = {
|
||||
.sv_sendsig = linux_rt_sendsig,
|
||||
.sv_sigcode = &_binary_linux_locore_o_start,
|
||||
.sv_szsigcode = &linux_szsigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "Linux ELF64",
|
||||
.sv_coredump = elf64_coredump,
|
||||
.sv_imgact_try = exec_linux_imgact_try,
|
||||
|
@ -1011,8 +1011,6 @@ struct sysentvec elf_linux_sysvec = {
|
||||
.sv_size = LINUX32_SYS_MAXSYSCALL,
|
||||
.sv_table = linux32_sysent,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = ELAST + 1,
|
||||
.sv_errtbl = bsd_to_linux_errno,
|
||||
.sv_transtrap = translate_traps,
|
||||
@ -1020,7 +1018,6 @@ struct sysentvec elf_linux_sysvec = {
|
||||
.sv_sendsig = linux_sendsig,
|
||||
.sv_sigcode = &_binary_linux32_locore_o_start,
|
||||
.sv_szsigcode = &linux_szsigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "Linux ELF32",
|
||||
.sv_coredump = elf32_coredump,
|
||||
.sv_imgact_try = exec_linux_imgact_try,
|
||||
|
@ -52,8 +52,6 @@ struct sysentvec elf32_freebsd_sysvec = {
|
||||
.sv_size = SYS_MAXSYSCALL,
|
||||
.sv_table = sysent,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = 0,
|
||||
.sv_errtbl = NULL,
|
||||
.sv_transtrap = NULL,
|
||||
@ -61,7 +59,6 @@ struct sysentvec elf32_freebsd_sysvec = {
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = sigcode,
|
||||
.sv_szsigcode = &szsigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD ELF32",
|
||||
.sv_coredump = __elfN(coredump),
|
||||
.sv_imgact_try = NULL,
|
||||
|
@ -59,8 +59,6 @@ static struct sysentvec elf64_freebsd_sysvec = {
|
||||
.sv_size = SYS_MAXSYSCALL,
|
||||
.sv_table = sysent,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = 0,
|
||||
.sv_errtbl = NULL,
|
||||
.sv_transtrap = NULL,
|
||||
@ -68,7 +66,6 @@ static struct sysentvec elf64_freebsd_sysvec = {
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = sigcode,
|
||||
.sv_szsigcode = &szsigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD ELF64",
|
||||
.sv_coredump = __elfN(coredump),
|
||||
.sv_imgact_try = NULL,
|
||||
|
@ -99,8 +99,6 @@ struct sysentvec ia32_freebsd_sysvec = {
|
||||
.sv_size = FREEBSD32_SYS_MAXSYSCALL,
|
||||
.sv_table = freebsd32_sysent,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = 0,
|
||||
.sv_errtbl = NULL,
|
||||
.sv_transtrap = NULL,
|
||||
@ -108,7 +106,6 @@ struct sysentvec ia32_freebsd_sysvec = {
|
||||
.sv_sendsig = ia32_sendsig,
|
||||
.sv_sigcode = ia32_sigcode,
|
||||
.sv_szsigcode = &sz_ia32_sigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD ELF32",
|
||||
.sv_coredump = elf32_coredump,
|
||||
.sv_imgact_try = NULL,
|
||||
|
@ -167,8 +167,6 @@ struct sysentvec svr4_sysvec = {
|
||||
.sv_size = SVR4_SYS_MAXSYSCALL,
|
||||
.sv_table = svr4_sysent,
|
||||
.sv_mask = 0xff,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = ELAST, /* ELAST */
|
||||
.sv_errtbl = bsd_to_svr4_errno,
|
||||
.sv_transtrap = NULL,
|
||||
@ -176,7 +174,6 @@ struct sysentvec svr4_sysvec = {
|
||||
.sv_sendsig = svr4_sendsig,
|
||||
.sv_sigcode = svr4_sigcode,
|
||||
.sv_szsigcode = &svr4_szsigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "SVR4",
|
||||
.sv_coredump = elf32_coredump,
|
||||
.sv_imgact_try = NULL,
|
||||
|
@ -57,8 +57,6 @@ struct sysentvec elf32_freebsd_sysvec = {
|
||||
.sv_size = SYS_MAXSYSCALL,
|
||||
.sv_table = sysent,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = 0,
|
||||
.sv_errtbl = NULL,
|
||||
.sv_transtrap = NULL,
|
||||
@ -66,7 +64,6 @@ struct sysentvec elf32_freebsd_sysvec = {
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = sigcode,
|
||||
.sv_szsigcode = &szsigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD ELF32",
|
||||
.sv_coredump = __elfN(coredump),
|
||||
.sv_imgact_try = NULL,
|
||||
|
@ -691,10 +691,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
|
||||
/* Align to 16 bytes. */
|
||||
sfp = (struct sigframe *)((unsigned int)sp & ~0xF);
|
||||
|
||||
/* Translate the signal if appropriate. */
|
||||
if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize)
|
||||
sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
|
||||
|
||||
/* Build the argument list for the signal handler. */
|
||||
sf.sf_signum = sig;
|
||||
sf.sf_ucontext = (register_t)&sfp->sf_uc;
|
||||
|
@ -956,8 +956,6 @@ struct sysentvec linux_sysvec = {
|
||||
.sv_size = LINUX_SYS_MAXSYSCALL,
|
||||
.sv_table = linux_sysent,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = ELAST + 1,
|
||||
.sv_errtbl = bsd_to_linux_errno,
|
||||
.sv_transtrap = translate_traps,
|
||||
@ -965,7 +963,6 @@ struct sysentvec linux_sysvec = {
|
||||
.sv_sendsig = linux_sendsig,
|
||||
.sv_sigcode = &_binary_linux_locore_o_start,
|
||||
.sv_szsigcode = &linux_szsigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "Linux a.out",
|
||||
.sv_coredump = NULL,
|
||||
.sv_imgact_try = exec_linux_imgact_try,
|
||||
@ -995,8 +992,6 @@ struct sysentvec elf_linux_sysvec = {
|
||||
.sv_size = LINUX_SYS_MAXSYSCALL,
|
||||
.sv_table = linux_sysent,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = ELAST + 1,
|
||||
.sv_errtbl = bsd_to_linux_errno,
|
||||
.sv_transtrap = translate_traps,
|
||||
@ -1004,7 +999,6 @@ struct sysentvec elf_linux_sysvec = {
|
||||
.sv_sendsig = linux_sendsig,
|
||||
.sv_sigcode = &_binary_linux_locore_o_start,
|
||||
.sv_szsigcode = &linux_szsigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "Linux ELF",
|
||||
.sv_coredump = elf32_coredump,
|
||||
.sv_imgact_try = exec_linux_imgact_try,
|
||||
|
@ -70,8 +70,6 @@ struct sysentvec aout_sysvec = {
|
||||
.sv_size = SYS_MAXSYSCALL,
|
||||
.sv_table = sysent,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = 0,
|
||||
.sv_errtbl = NULL,
|
||||
.sv_transtrap = NULL,
|
||||
@ -79,7 +77,6 @@ struct sysentvec aout_sysvec = {
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = sigcode,
|
||||
.sv_szsigcode = &szsigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD a.out",
|
||||
.sv_coredump = NULL,
|
||||
.sv_imgact_try = NULL,
|
||||
@ -116,8 +113,6 @@ struct sysentvec aout_sysvec = {
|
||||
.sv_size = FREEBSD32_SYS_MAXSYSCALL,
|
||||
.sv_table = freebsd32_sysent,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = 0,
|
||||
.sv_errtbl = NULL,
|
||||
.sv_transtrap = NULL,
|
||||
@ -125,7 +120,6 @@ struct sysentvec aout_sysvec = {
|
||||
.sv_sendsig = ia32_sendsig,
|
||||
.sv_sigcode = ia32_sigcode,
|
||||
.sv_szsigcode = &sz_ia32_sigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD a.out",
|
||||
.sv_coredump = NULL,
|
||||
.sv_imgact_try = NULL,
|
||||
|
@ -387,8 +387,6 @@ struct sysentvec null_sysvec = {
|
||||
.sv_size = 0,
|
||||
.sv_table = NULL,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = 0,
|
||||
.sv_errtbl = NULL,
|
||||
.sv_transtrap = NULL,
|
||||
@ -396,7 +394,6 @@ struct sysentvec null_sysvec = {
|
||||
.sv_sendsig = NULL,
|
||||
.sv_sigcode = NULL,
|
||||
.sv_szsigcode = NULL,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "null",
|
||||
.sv_coredump = NULL,
|
||||
.sv_imgact_try = NULL,
|
||||
|
@ -54,8 +54,6 @@ struct sysentvec elf64_freebsd_sysvec = {
|
||||
.sv_size = SYS_MAXSYSCALL,
|
||||
.sv_table = sysent,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = 0,
|
||||
.sv_errtbl = NULL,
|
||||
.sv_transtrap = NULL,
|
||||
@ -63,7 +61,6 @@ struct sysentvec elf64_freebsd_sysvec = {
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = sigcode,
|
||||
.sv_szsigcode = &szsigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD ELF64",
|
||||
.sv_coredump = __elfN(coredump),
|
||||
.sv_imgact_try = NULL,
|
||||
@ -111,8 +108,6 @@ struct sysentvec elf32_freebsd_sysvec = {
|
||||
.sv_size = SYS_MAXSYSCALL,
|
||||
.sv_table = sysent,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = 0,
|
||||
.sv_errtbl = NULL,
|
||||
.sv_transtrap = NULL,
|
||||
@ -120,7 +115,6 @@ struct sysentvec elf32_freebsd_sysvec = {
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = sigcode,
|
||||
.sv_szsigcode = &szsigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD ELF32",
|
||||
.sv_coredump = __elfN(coredump),
|
||||
.sv_imgact_try = NULL,
|
||||
|
@ -77,8 +77,6 @@ struct sysentvec elf32_freebsd_sysvec = {
|
||||
.sv_size = SYS_MAXSYSCALL,
|
||||
.sv_table = freebsd32_sysent,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = 0,
|
||||
.sv_errtbl = NULL,
|
||||
.sv_transtrap = NULL,
|
||||
@ -86,7 +84,6 @@ struct sysentvec elf32_freebsd_sysvec = {
|
||||
.sv_sendsig = freebsd32_sendsig,
|
||||
.sv_sigcode = sigcode32,
|
||||
.sv_szsigcode = &szsigcode32,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD ELF32",
|
||||
.sv_coredump = __elfN(coredump),
|
||||
.sv_imgact_try = NULL,
|
||||
|
@ -68,8 +68,6 @@ struct sysentvec elf32_freebsd_sysvec = {
|
||||
.sv_table = sysent,
|
||||
#endif
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = 0,
|
||||
.sv_errtbl = NULL,
|
||||
.sv_transtrap = NULL,
|
||||
@ -77,7 +75,6 @@ struct sysentvec elf32_freebsd_sysvec = {
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = sigcode32,
|
||||
.sv_szsigcode = &szsigcode32,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD ELF32",
|
||||
.sv_coredump = __elfN(coredump),
|
||||
.sv_imgact_try = NULL,
|
||||
|
@ -56,8 +56,6 @@ struct sysentvec elf64_freebsd_sysvec_v1 = {
|
||||
.sv_size = SYS_MAXSYSCALL,
|
||||
.sv_table = sysent,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = 0,
|
||||
.sv_errtbl = NULL,
|
||||
.sv_transtrap = NULL,
|
||||
@ -65,7 +63,6 @@ struct sysentvec elf64_freebsd_sysvec_v1 = {
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = sigcode64,
|
||||
.sv_szsigcode = &szsigcode64,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD ELF64",
|
||||
.sv_coredump = __elfN(coredump),
|
||||
.sv_imgact_try = NULL,
|
||||
@ -95,8 +92,6 @@ struct sysentvec elf64_freebsd_sysvec_v2 = {
|
||||
.sv_size = SYS_MAXSYSCALL,
|
||||
.sv_table = sysent,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = 0,
|
||||
.sv_errtbl = NULL,
|
||||
.sv_transtrap = NULL,
|
||||
@ -104,7 +99,6 @@ struct sysentvec elf64_freebsd_sysvec_v2 = {
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = sigcode64_elfv2,
|
||||
.sv_szsigcode = &szsigcode64_elfv2,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD ELF64 V2",
|
||||
.sv_coredump = __elfN(coredump),
|
||||
.sv_imgact_try = NULL,
|
||||
|
@ -58,8 +58,6 @@ static struct sysentvec elf64_freebsd_sysvec = {
|
||||
.sv_size = SYS_MAXSYSCALL,
|
||||
.sv_table = sysent,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = 0,
|
||||
.sv_errtbl = NULL,
|
||||
.sv_transtrap = NULL,
|
||||
@ -67,7 +65,6 @@ static struct sysentvec elf64_freebsd_sysvec = {
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = NULL,
|
||||
.sv_szsigcode = NULL,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD ELF64",
|
||||
.sv_coredump = __elfN(coredump),
|
||||
.sv_imgact_try = NULL,
|
||||
|
@ -92,8 +92,6 @@ struct sysentvec {
|
||||
int sv_size; /* number of entries */
|
||||
struct sysent *sv_table; /* pointer to sysent */
|
||||
u_int sv_mask; /* optional mask to index */
|
||||
int sv_sigsize; /* size of signal translation table */
|
||||
int *sv_sigtbl; /* signal translation table */
|
||||
int sv_errsize; /* size of errno translation table */
|
||||
int *sv_errtbl; /* errno translation table */
|
||||
int (*sv_transtrap)(int, int);
|
||||
@ -104,8 +102,6 @@ struct sysentvec {
|
||||
/* send signal */
|
||||
char *sv_sigcode; /* start of sigtramp code */
|
||||
int *sv_szsigcode; /* size of sigtramp code */
|
||||
void (*sv_prepsyscall)(struct trapframe *, int *, u_int *,
|
||||
caddr_t *);
|
||||
char *sv_name; /* name of binary type */
|
||||
int (*sv_coredump)(struct thread *, struct vnode *, off_t, int);
|
||||
/* function to dump core, or NULL */
|
||||
|
Loading…
Reference in New Issue
Block a user