Change the static struct sysentvec and struct Elf_Brandinfo initializers
to the C99 style. At least, it is easier to read sysent definitions that way, and search for the actual instances of sigcode etc. Explicitely initialize sysentvec.sv_maxssiz that was missed in most sysvecs. No objection from: jhb MFC after: 1 month
This commit is contained in:
parent
a7db7fbd35
commit
a8d403e102
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=183322
@ -46,59 +46,60 @@ __FBSDID("$FreeBSD$");
|
||||
#include <machine/md_var.h>
|
||||
|
||||
struct sysentvec elf64_freebsd_sysvec = {
|
||||
SYS_MAXSYSCALL,
|
||||
sysent,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
__elfN(freebsd_fixup),
|
||||
sendsig,
|
||||
sigcode,
|
||||
&szsigcode,
|
||||
NULL,
|
||||
"FreeBSD ELF64",
|
||||
__elfN(coredump),
|
||||
NULL,
|
||||
MINSIGSTKSZ,
|
||||
PAGE_SIZE,
|
||||
VM_MIN_ADDRESS,
|
||||
VM_MAXUSER_ADDRESS,
|
||||
USRSTACK,
|
||||
PS_STRINGS,
|
||||
VM_PROT_ALL,
|
||||
exec_copyout_strings,
|
||||
exec_setregs,
|
||||
NULL
|
||||
.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,
|
||||
.sv_fixup = __elfN(freebsd_fixup),
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = sigcode,
|
||||
.sv_szsigcode = &szsigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD ELF64",
|
||||
.sv_coredump = __elfN(coredump),
|
||||
.sv_imgact_try = NULL,
|
||||
.sv_minsigstksz = MINSIGSTKSZ,
|
||||
.sv_pagesize = PAGE_SIZE,
|
||||
.sv_minuser = VM_MIN_ADDRESS,
|
||||
.sv_maxuser = VM_MAXUSER_ADDRESS,
|
||||
.sv_usrstack = USRSTACK,
|
||||
.sv_psstrings = PS_STRINGS,
|
||||
.sv_stackprot = VM_PROT_ALL,
|
||||
.sv_copyout_strings = exec_copyout_strings,
|
||||
.sv_setregs = exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL
|
||||
};
|
||||
|
||||
static Elf64_Brandinfo freebsd_brand_info = {
|
||||
ELFOSABI_FREEBSD,
|
||||
EM_X86_64,
|
||||
"FreeBSD",
|
||||
NULL,
|
||||
"/libexec/ld-elf.so.1",
|
||||
&elf64_freebsd_sysvec,
|
||||
NULL,
|
||||
BI_CAN_EXEC_DYN,
|
||||
};
|
||||
.brand = ELFOSABI_FREEBSD,
|
||||
.machine = EM_X86_64,
|
||||
.compat_3_brand = "FreeBSD",
|
||||
.emul_path = NULL,
|
||||
.interp_path = "/libexec/ld-elf.so.1",
|
||||
.sysvec = &elf64_freebsd_sysvec,
|
||||
.interp_newpath = NULL,
|
||||
.flags = BI_CAN_EXEC_DYN,
|
||||
};
|
||||
|
||||
SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY,
|
||||
(sysinit_cfunc_t) elf64_insert_brand_entry,
|
||||
&freebsd_brand_info);
|
||||
|
||||
static Elf64_Brandinfo freebsd_brand_oinfo = {
|
||||
ELFOSABI_FREEBSD,
|
||||
EM_X86_64,
|
||||
"FreeBSD",
|
||||
NULL,
|
||||
"/usr/libexec/ld-elf.so.1",
|
||||
&elf64_freebsd_sysvec,
|
||||
NULL,
|
||||
BI_CAN_EXEC_DYN,
|
||||
};
|
||||
.brand = ELFOSABI_FREEBSD,
|
||||
.machine = EM_X86_64,
|
||||
.compat_3_brand = "FreeBSD",
|
||||
.emul_path = NULL,
|
||||
.interp_path = "/usr/libexec/ld-elf.so.1",
|
||||
.sysvec = &elf64_freebsd_sysvec,
|
||||
.interp_newpath = NULL,
|
||||
.flags = BI_CAN_EXEC_DYN,
|
||||
};
|
||||
|
||||
SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY,
|
||||
(sysinit_cfunc_t) elf64_insert_brand_entry,
|
||||
|
@ -1000,62 +1000,62 @@ linux32_fixlimit(struct rlimit *rl, int which)
|
||||
}
|
||||
|
||||
struct sysentvec elf_linux_sysvec = {
|
||||
LINUX_SYS_MAXSYSCALL,
|
||||
linux_sysent,
|
||||
0,
|
||||
LINUX_SIGTBLSZ,
|
||||
bsd_to_linux_signal,
|
||||
ELAST + 1,
|
||||
bsd_to_linux_errno,
|
||||
translate_traps,
|
||||
elf_linux_fixup,
|
||||
linux_sendsig,
|
||||
linux_sigcode,
|
||||
&linux_szsigcode,
|
||||
linux_prepsyscall,
|
||||
"Linux ELF32",
|
||||
elf32_coredump,
|
||||
exec_linux_imgact_try,
|
||||
LINUX_MINSIGSTKSZ,
|
||||
PAGE_SIZE,
|
||||
VM_MIN_ADDRESS,
|
||||
LINUX32_USRSTACK,
|
||||
LINUX32_USRSTACK,
|
||||
LINUX32_PS_STRINGS,
|
||||
VM_PROT_ALL,
|
||||
linux_copyout_strings,
|
||||
exec_linux_setregs,
|
||||
linux32_fixlimit,
|
||||
&linux32_maxssiz,
|
||||
.sv_size = LINUX_SYS_MAXSYSCALL,
|
||||
.sv_table = linux_sysent,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = LINUX_SIGTBLSZ,
|
||||
.sv_sigtbl = bsd_to_linux_signal,
|
||||
.sv_errsize = ELAST + 1,
|
||||
.sv_errtbl = bsd_to_linux_errno,
|
||||
.sv_transtrap = translate_traps,
|
||||
.sv_fixup = elf_linux_fixup,
|
||||
.sv_sendsig = linux_sendsig,
|
||||
.sv_sigcode = linux_sigcode,
|
||||
.sv_szsigcode = &linux_szsigcode,
|
||||
.sv_prepsyscall = linux_prepsyscall,
|
||||
.sv_name = "Linux ELF32",
|
||||
.sv_coredump = elf32_coredump,
|
||||
.sv_imgact_try = exec_linux_imgact_try,
|
||||
.sv_minsigstksz = LINUX_MINSIGSTKSZ,
|
||||
.sv_pagesize = PAGE_SIZE,
|
||||
.sv_minuser = VM_MIN_ADDRESS,
|
||||
.sv_maxuser = LINUX32_USRSTACK,
|
||||
.sv_usrstack = LINUX32_USRSTACK,
|
||||
.sv_psstrings = LINUX32_PS_STRINGS,
|
||||
.sv_stackprot = VM_PROT_ALL,
|
||||
.sv_copyout_strings = linux_copyout_strings,
|
||||
.sv_setregs = exec_linux_setregs,
|
||||
.sv_fixlimit = linux32_fixlimit,
|
||||
.sv_maxssiz = &linux32_maxssiz,
|
||||
};
|
||||
|
||||
static Elf32_Brandinfo linux_brand = {
|
||||
ELFOSABI_LINUX,
|
||||
EM_386,
|
||||
"Linux",
|
||||
"/compat/linux",
|
||||
"/lib/ld-linux.so.1",
|
||||
&elf_linux_sysvec,
|
||||
NULL,
|
||||
BI_CAN_EXEC_DYN,
|
||||
};
|
||||
.brand = ELFOSABI_LINUX,
|
||||
.machine = EM_386,
|
||||
.compat_3_brand = "Linux",
|
||||
.emul_path = "/compat/linux",
|
||||
.interp_path = "/lib/ld-linux.so.1",
|
||||
.sysvec = &elf_linux_sysvec,
|
||||
.interp_newpath = NULL,
|
||||
.flags = BI_CAN_EXEC_DYN,
|
||||
};
|
||||
|
||||
static Elf32_Brandinfo linux_glibc2brand = {
|
||||
ELFOSABI_LINUX,
|
||||
EM_386,
|
||||
"Linux",
|
||||
"/compat/linux",
|
||||
"/lib/ld-linux.so.2",
|
||||
&elf_linux_sysvec,
|
||||
NULL,
|
||||
BI_CAN_EXEC_DYN,
|
||||
};
|
||||
.brand = ELFOSABI_LINUX,
|
||||
.machine = EM_386,
|
||||
.compat_3_brand = "Linux",
|
||||
.emul_path = "/compat/linux",
|
||||
.interp_path = "/lib/ld-linux.so.2",
|
||||
.sysvec = &elf_linux_sysvec,
|
||||
.interp_newpath = NULL,
|
||||
.flags = BI_CAN_EXEC_DYN,
|
||||
};
|
||||
|
||||
Elf32_Brandinfo *linux_brandlist[] = {
|
||||
&linux_brand,
|
||||
&linux_glibc2brand,
|
||||
NULL
|
||||
};
|
||||
&linux_brand,
|
||||
&linux_glibc2brand,
|
||||
NULL
|
||||
};
|
||||
|
||||
static int
|
||||
linux_elf_modevent(module_t mod, int type, void *data)
|
||||
|
@ -46,59 +46,60 @@ __FBSDID("$FreeBSD$");
|
||||
#include <machine/md_var.h>
|
||||
|
||||
struct sysentvec elf32_freebsd_sysvec = {
|
||||
SYS_MAXSYSCALL,
|
||||
sysent,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
__elfN(freebsd_fixup),
|
||||
sendsig,
|
||||
sigcode,
|
||||
&szsigcode,
|
||||
NULL,
|
||||
"FreeBSD ELF32",
|
||||
__elfN(coredump),
|
||||
NULL,
|
||||
MINSIGSTKSZ,
|
||||
PAGE_SIZE,
|
||||
VM_MIN_ADDRESS,
|
||||
VM_MAXUSER_ADDRESS,
|
||||
USRSTACK,
|
||||
PS_STRINGS,
|
||||
VM_PROT_ALL,
|
||||
exec_copyout_strings,
|
||||
exec_setregs,
|
||||
NULL
|
||||
.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,
|
||||
.sv_fixup = __elfN(freebsd_fixup),
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = sigcode,
|
||||
.sv_szsigcode = &szsigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD ELF32",
|
||||
.sv_coredump = __elfN(coredump),
|
||||
.sv_imgact_try = NULL,
|
||||
.sv_minsigstksz = MINSIGSTKSZ,
|
||||
.sv_pagesize = PAGE_SIZE,
|
||||
.sv_minuser = VM_MIN_ADDRESS,
|
||||
.sv_maxuser = VM_MAXUSER_ADDRESS,
|
||||
.sv_usrstack = USRSTACK,
|
||||
.sv_psstrings = PS_STRINGS,
|
||||
.sv_stackprot = VM_PROT_ALL,
|
||||
.sv_copyout_strings = exec_copyout_strings,
|
||||
.sv_setregs = exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL
|
||||
};
|
||||
|
||||
static Elf32_Brandinfo freebsd_brand_info = {
|
||||
ELFOSABI_FREEBSD,
|
||||
EM_ARM,
|
||||
"FreeBSD",
|
||||
NULL,
|
||||
"/libexec/ld-elf.so.1",
|
||||
&elf32_freebsd_sysvec,
|
||||
NULL,
|
||||
BI_CAN_EXEC_DYN,
|
||||
};
|
||||
.brand = ELFOSABI_FREEBSD,
|
||||
.machine = EM_ARM,
|
||||
.compat_3_brand = "FreeBSD",
|
||||
.emul_path = NULL,
|
||||
.interp_path = "/libexec/ld-elf.so.1",
|
||||
.sysvec = &elf32_freebsd_sysvec,
|
||||
.interp_newpath = NULL,
|
||||
.flags = BI_CAN_EXEC_DYN,
|
||||
};
|
||||
|
||||
SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY,
|
||||
(sysinit_cfunc_t) elf32_insert_brand_entry,
|
||||
&freebsd_brand_info);
|
||||
|
||||
static Elf32_Brandinfo freebsd_brand_oinfo = {
|
||||
ELFOSABI_FREEBSD,
|
||||
EM_ARM,
|
||||
"FreeBSD",
|
||||
NULL,
|
||||
"/usr/libexec/ld-elf.so.1",
|
||||
&elf32_freebsd_sysvec,
|
||||
NULL,
|
||||
BI_CAN_EXEC_DYN,
|
||||
};
|
||||
.brand = ELFOSABI_FREEBSD,
|
||||
.machine = EM_ARM,
|
||||
.compat_3_brand = "FreeBSD",
|
||||
.emul_path = NULL,
|
||||
.interp_path = "/usr/libexec/ld-elf.so.1",
|
||||
.sysvec = &elf32_freebsd_sysvec,
|
||||
.interp_newpath = NULL,
|
||||
.flags = BI_CAN_EXEC_DYN,
|
||||
};
|
||||
|
||||
SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY,
|
||||
(sysinit_cfunc_t) elf32_insert_brand_entry,
|
||||
|
@ -111,61 +111,61 @@ SYSCTL_ULONG(_compat_ia32, OID_AUTO, maxvmem, CTLFLAG_RW, &ia32_maxvmem, 0, "");
|
||||
TUNABLE_ULONG("compat.ia32.maxvmem", &ia32_maxvmem);
|
||||
|
||||
struct sysentvec ia32_freebsd_sysvec = {
|
||||
FREEBSD32_SYS_MAXSYSCALL,
|
||||
freebsd32_sysent,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
elf32_freebsd_fixup,
|
||||
ia32_sendsig,
|
||||
ia32_sigcode,
|
||||
&sz_ia32_sigcode,
|
||||
NULL,
|
||||
"FreeBSD ELF32",
|
||||
elf32_coredump,
|
||||
NULL,
|
||||
MINSIGSTKSZ,
|
||||
IA32_PAGE_SIZE,
|
||||
0,
|
||||
FREEBSD32_USRSTACK,
|
||||
FREEBSD32_USRSTACK,
|
||||
FREEBSD32_PS_STRINGS,
|
||||
VM_PROT_ALL,
|
||||
ia32_copyout_strings,
|
||||
ia32_setregs,
|
||||
ia32_fixlimit,
|
||||
&ia32_maxssiz
|
||||
.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,
|
||||
.sv_fixup = elf32_freebsd_fixup,
|
||||
.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,
|
||||
.sv_minsigstksz = MINSIGSTKSZ,
|
||||
.sv_pagesize = IA32_PAGE_SIZE,
|
||||
.sv_minuser = 0,
|
||||
.sv_maxuser = FREEBSD32_USRSTACK,
|
||||
.sv_usrstack = FREEBSD32_USRSTACK,
|
||||
.sv_psstrings = FREEBSD32_PS_STRINGS,
|
||||
.sv_stackprot = VM_PROT_ALL,
|
||||
.sv_copyout_strings = ia32_copyout_strings,
|
||||
.sv_setregs = ia32_setregs,
|
||||
.sv_fixlimit = ia32_fixlimit,
|
||||
.sv_maxssiz = &ia32_maxssiz
|
||||
};
|
||||
|
||||
|
||||
static Elf32_Brandinfo ia32_brand_info = {
|
||||
ELFOSABI_FREEBSD,
|
||||
EM_386,
|
||||
"FreeBSD",
|
||||
NULL,
|
||||
"/libexec/ld-elf.so.1",
|
||||
&ia32_freebsd_sysvec,
|
||||
"/libexec/ld-elf32.so.1",
|
||||
BI_CAN_EXEC_DYN,
|
||||
};
|
||||
.brand = ELFOSABI_FREEBSD,
|
||||
.machine = EM_386,
|
||||
.compat_3_brand = "FreeBSD",
|
||||
.emul_path = NULL,
|
||||
.interp_path = "/libexec/ld-elf.so.1",
|
||||
.sysvec = &ia32_freebsd_sysvec,
|
||||
.interp_newpath = "/libexec/ld-elf32.so.1",
|
||||
.flags = BI_CAN_EXEC_DYN
|
||||
};
|
||||
|
||||
SYSINIT(ia32, SI_SUB_EXEC, SI_ORDER_ANY,
|
||||
(sysinit_cfunc_t) elf32_insert_brand_entry,
|
||||
&ia32_brand_info);
|
||||
|
||||
static Elf32_Brandinfo ia32_brand_oinfo = {
|
||||
ELFOSABI_FREEBSD,
|
||||
EM_386,
|
||||
"FreeBSD",
|
||||
NULL,
|
||||
"/usr/libexec/ld-elf.so.1",
|
||||
&ia32_freebsd_sysvec,
|
||||
"/libexec/ld-elf32.so.1",
|
||||
BI_CAN_EXEC_DYN,
|
||||
};
|
||||
.brand = ELFOSABI_FREEBSD,
|
||||
.machine = EM_386,
|
||||
.compat_3_brand = "FreeBSD",
|
||||
.emul_path = NULL,
|
||||
.interp_path = "/usr/libexec/ld-elf.so.1",
|
||||
.sysvec = &ia32_freebsd_sysvec,
|
||||
.interp_newpath = "/libexec/ld-elf32.so.1",
|
||||
.flags = BI_CAN_EXEC_DYN,
|
||||
};
|
||||
|
||||
SYSINIT(oia32, SI_SUB_EXEC, SI_ORDER_ANY,
|
||||
(sysinit_cfunc_t) elf32_insert_brand_entry,
|
||||
|
@ -164,44 +164,46 @@ extern int svr4_szsigcode;
|
||||
extern char svr4_sigcode[];
|
||||
|
||||
struct sysentvec svr4_sysvec = {
|
||||
SVR4_SYS_MAXSYSCALL,
|
||||
svr4_sysent,
|
||||
0xff,
|
||||
SVR4_NSIG-1, /* NB: signal trans table indexed with signno-1 */
|
||||
bsd_to_svr4_sig+1,
|
||||
ELAST, /* ELAST */
|
||||
bsd_to_svr4_errno,
|
||||
NULL,
|
||||
svr4_fixup,
|
||||
svr4_sendsig,
|
||||
svr4_sigcode,
|
||||
&svr4_szsigcode,
|
||||
NULL,
|
||||
"SVR4",
|
||||
elf32_coredump,
|
||||
NULL,
|
||||
SVR4_MINSIGSTKSZ,
|
||||
PAGE_SIZE,
|
||||
VM_MIN_ADDRESS,
|
||||
VM_MAXUSER_ADDRESS,
|
||||
USRSTACK,
|
||||
PS_STRINGS,
|
||||
VM_PROT_ALL,
|
||||
exec_copyout_strings,
|
||||
exec_setregs,
|
||||
NULL
|
||||
.sv_size = SVR4_SYS_MAXSYSCALL,
|
||||
.sv_table = svr4_sysent,
|
||||
.sv_mask = 0xff,
|
||||
.sv_sigsize = SVR4_NSIG-1, /* NB: signal trans table indexed with signno-1 */
|
||||
.sv_sigtbl = bsd_to_svr4_sig+1,
|
||||
.sv_errsize = ELAST, /* ELAST */
|
||||
.sv_errtbl = bsd_to_svr4_errno,
|
||||
.sv_transtrap = NULL,
|
||||
.sv_fixup = svr4_fixup,
|
||||
.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,
|
||||
.sv_minsigstksz = SVR4_MINSIGSTKSZ,
|
||||
.sv_pagesize = PAGE_SIZE,
|
||||
.sv_minuser = VM_MIN_ADDRESS,
|
||||
.sv_maxuser = VM_MAXUSER_ADDRESS,
|
||||
.sv_usrstack = USRSTACK,
|
||||
.sv_psstrings = PS_STRINGS,
|
||||
.sv_stackprot = VM_PROT_ALL,
|
||||
.sv_copyout_strings = exec_copyout_strings,
|
||||
.sv_setregs = exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL
|
||||
};
|
||||
|
||||
const char svr4_emul_path[] = "/compat/svr4";
|
||||
|
||||
Elf32_Brandinfo svr4_brand = {
|
||||
ELFOSABI_SYSV,
|
||||
EM_386, /* XXX only implemented for x86 so far. */
|
||||
"SVR4",
|
||||
svr4_emul_path,
|
||||
"/lib/libc.so.1",
|
||||
&svr4_sysvec,
|
||||
NULL,
|
||||
.brand = ELFOSABI_SYSV,
|
||||
.machine = EM_386, /* XXX only implemented for x86 so far. */
|
||||
.compat_3_brand = "SVR4",
|
||||
.emul_path = svr4_emul_path,
|
||||
.interp_path = "/lib/libc.so.1",
|
||||
.sysvec = &svr4_sysvec,
|
||||
.interp_newpath = NULL,
|
||||
.flags = 0
|
||||
};
|
||||
|
||||
static int
|
||||
|
@ -46,59 +46,60 @@ __FBSDID("$FreeBSD$");
|
||||
#include <machine/md_var.h>
|
||||
|
||||
struct sysentvec elf32_freebsd_sysvec = {
|
||||
SYS_MAXSYSCALL,
|
||||
sysent,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
__elfN(freebsd_fixup),
|
||||
sendsig,
|
||||
sigcode,
|
||||
&szsigcode,
|
||||
NULL,
|
||||
"FreeBSD ELF32",
|
||||
__elfN(coredump),
|
||||
NULL,
|
||||
MINSIGSTKSZ,
|
||||
PAGE_SIZE,
|
||||
VM_MIN_ADDRESS,
|
||||
VM_MAXUSER_ADDRESS,
|
||||
USRSTACK,
|
||||
PS_STRINGS,
|
||||
VM_PROT_ALL,
|
||||
exec_copyout_strings,
|
||||
exec_setregs,
|
||||
NULL
|
||||
.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,
|
||||
.sv_fixup = __elfN(freebsd_fixup),
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = sigcode,
|
||||
.sv_szsigcode = &szsigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD ELF32",
|
||||
.sv_coredump = __elfN(coredump),
|
||||
.sv_imgact_try = NULL,
|
||||
.sv_minsigstksz = MINSIGSTKSZ,
|
||||
.sv_pagesize = PAGE_SIZE,
|
||||
.sv_minuser = VM_MIN_ADDRESS,
|
||||
.sv_maxuser = VM_MAXUSER_ADDRESS,
|
||||
.sv_usrstack = USRSTACK,
|
||||
.sv_psstrings = PS_STRINGS,
|
||||
.sv_stackprot = VM_PROT_ALL,
|
||||
.sv_copyout_strings = exec_copyout_strings,
|
||||
.sv_setregs = exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL
|
||||
};
|
||||
|
||||
static Elf32_Brandinfo freebsd_brand_info = {
|
||||
ELFOSABI_FREEBSD,
|
||||
EM_386,
|
||||
"FreeBSD",
|
||||
NULL,
|
||||
"/libexec/ld-elf.so.1",
|
||||
&elf32_freebsd_sysvec,
|
||||
NULL,
|
||||
BI_CAN_EXEC_DYN,
|
||||
};
|
||||
.brand = ELFOSABI_FREEBSD,
|
||||
.machine = EM_386,
|
||||
.compat_3_brand = "FreeBSD",
|
||||
.emul_path = NULL,
|
||||
.interp_path = "/libexec/ld-elf.so.1",
|
||||
.sysvec = &elf32_freebsd_sysvec,
|
||||
.interp_newpath = NULL,
|
||||
.flags = BI_CAN_EXEC_DYN,
|
||||
};
|
||||
|
||||
SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY,
|
||||
(sysinit_cfunc_t) elf32_insert_brand_entry,
|
||||
&freebsd_brand_info);
|
||||
|
||||
static Elf32_Brandinfo freebsd_brand_oinfo = {
|
||||
ELFOSABI_FREEBSD,
|
||||
EM_386,
|
||||
"FreeBSD",
|
||||
NULL,
|
||||
"/usr/libexec/ld-elf.so.1",
|
||||
&elf32_freebsd_sysvec,
|
||||
NULL,
|
||||
BI_CAN_EXEC_DYN,
|
||||
};
|
||||
.brand = ELFOSABI_FREEBSD,
|
||||
.machine = EM_386,
|
||||
.compat_3_brand = "FreeBSD",
|
||||
.emul_path = NULL,
|
||||
.interp_path = "/usr/libexec/ld-elf.so.1",
|
||||
.sysvec = &elf32_freebsd_sysvec,
|
||||
.interp_newpath = NULL,
|
||||
.flags = BI_CAN_EXEC_DYN,
|
||||
};
|
||||
|
||||
SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY,
|
||||
(sysinit_cfunc_t) elf32_insert_brand_entry,
|
||||
|
@ -59,32 +59,33 @@ extern char sigcode[];
|
||||
static int ibcs2_fixup(register_t **, struct image_params *);
|
||||
|
||||
struct sysentvec ibcs2_svr3_sysvec = {
|
||||
sizeof (ibcs2_sysent) / sizeof (ibcs2_sysent[0]),
|
||||
ibcs2_sysent,
|
||||
0xFF,
|
||||
IBCS2_SIGTBLSZ,
|
||||
bsd_to_ibcs2_sig,
|
||||
ELAST + 1,
|
||||
bsd_to_ibcs2_errno,
|
||||
NULL, /* trap-to-signal translation function */
|
||||
ibcs2_fixup, /* fixup */
|
||||
sendsig,
|
||||
sigcode, /* use generic trampoline */
|
||||
&szsigcode, /* use generic trampoline size */
|
||||
NULL, /* prepsyscall */
|
||||
"IBCS2 COFF",
|
||||
NULL, /* we don't have a COFF coredump function */
|
||||
NULL,
|
||||
IBCS2_MINSIGSTKSZ,
|
||||
PAGE_SIZE,
|
||||
VM_MIN_ADDRESS,
|
||||
VM_MAXUSER_ADDRESS,
|
||||
USRSTACK,
|
||||
PS_STRINGS,
|
||||
VM_PROT_ALL,
|
||||
exec_copyout_strings,
|
||||
exec_setregs,
|
||||
NULL
|
||||
.sv_size = sizeof (ibcs2_sysent) / sizeof (ibcs2_sysent[0]),
|
||||
.sv_table = ibcs2_sysent,
|
||||
.sv_mask = 0xff,
|
||||
.sv_sigsize = IBCS2_SIGTBLSZ,
|
||||
.sv_sigtbl = bsd_to_ibcs2_sig,
|
||||
.sv_errsize = ELAST + 1,
|
||||
.sv_errtbl = bsd_to_ibcs2_errno,
|
||||
.sv_transtrap = NULL,
|
||||
.sv_fixup = ibcs2_fixup,
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = sigcode, /* use generic trampoline */
|
||||
.sv_szsigcode = &szsigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "IBCS2 COFF",
|
||||
.sv_coredump = NULL, /* we don't have a COFF coredump function */
|
||||
.sv_imgact_try = NULL,
|
||||
.sv_minsigstksz = IBCS2_MINSIGSTKSZ,
|
||||
.sv_pagesize = PAGE_SIZE,
|
||||
.sv_minuser = VM_MIN_ADDRESS,
|
||||
.sv_maxuser = VM_MAXUSER_ADDRESS,
|
||||
.sv_usrstack = USRSTACK,
|
||||
.sv_psstrings = PS_STRINGS,
|
||||
.sv_stackprot = VM_PROT_ALL,
|
||||
.sv_copyout_strings = exec_copyout_strings,
|
||||
.sv_setregs = exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL
|
||||
};
|
||||
|
||||
static int
|
||||
|
@ -813,90 +813,92 @@ exec_linux_setregs(struct thread *td, u_long entry,
|
||||
}
|
||||
|
||||
struct sysentvec linux_sysvec = {
|
||||
LINUX_SYS_MAXSYSCALL,
|
||||
linux_sysent,
|
||||
0,
|
||||
LINUX_SIGTBLSZ,
|
||||
bsd_to_linux_signal,
|
||||
ELAST + 1,
|
||||
bsd_to_linux_errno,
|
||||
translate_traps,
|
||||
linux_fixup,
|
||||
linux_sendsig,
|
||||
linux_sigcode,
|
||||
&linux_szsigcode,
|
||||
linux_prepsyscall,
|
||||
"Linux a.out",
|
||||
NULL,
|
||||
exec_linux_imgact_try,
|
||||
LINUX_MINSIGSTKSZ,
|
||||
PAGE_SIZE,
|
||||
VM_MIN_ADDRESS,
|
||||
VM_MAXUSER_ADDRESS,
|
||||
USRSTACK,
|
||||
PS_STRINGS,
|
||||
VM_PROT_ALL,
|
||||
exec_copyout_strings,
|
||||
exec_linux_setregs,
|
||||
NULL
|
||||
.sv_size = LINUX_SYS_MAXSYSCALL,
|
||||
.sv_table = linux_sysent,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = LINUX_SIGTBLSZ,
|
||||
.sv_sigtbl = bsd_to_linux_signal,
|
||||
.sv_errsize = ELAST + 1,
|
||||
.sv_errtbl = bsd_to_linux_errno,
|
||||
.sv_transtrap = translate_traps,
|
||||
.sv_fixup = linux_fixup,
|
||||
.sv_sendsig = linux_sendsig,
|
||||
.sv_sigcode = linux_sigcode,
|
||||
.sv_szsigcode = &linux_szsigcode,
|
||||
.sv_prepsyscall = linux_prepsyscall,
|
||||
.sv_name = "Linux a.out",
|
||||
.sv_coredump = NULL,
|
||||
.sv_imgact_try = exec_linux_imgact_try,
|
||||
.sv_minsigstksz = LINUX_MINSIGSTKSZ,
|
||||
.sv_pagesize = PAGE_SIZE,
|
||||
.sv_minuser = VM_MIN_ADDRESS,
|
||||
.sv_maxuser = VM_MAXUSER_ADDRESS,
|
||||
.sv_usrstack = USRSTACK,
|
||||
.sv_psstrings = PS_STRINGS,
|
||||
.sv_stackprot = VM_PROT_ALL,
|
||||
.sv_copyout_strings = exec_copyout_strings,
|
||||
.sv_setregs = exec_linux_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL
|
||||
};
|
||||
|
||||
struct sysentvec elf_linux_sysvec = {
|
||||
LINUX_SYS_MAXSYSCALL,
|
||||
linux_sysent,
|
||||
0,
|
||||
LINUX_SIGTBLSZ,
|
||||
bsd_to_linux_signal,
|
||||
ELAST + 1,
|
||||
bsd_to_linux_errno,
|
||||
translate_traps,
|
||||
elf_linux_fixup,
|
||||
linux_sendsig,
|
||||
linux_sigcode,
|
||||
&linux_szsigcode,
|
||||
linux_prepsyscall,
|
||||
"Linux ELF",
|
||||
elf32_coredump,
|
||||
exec_linux_imgact_try,
|
||||
LINUX_MINSIGSTKSZ,
|
||||
PAGE_SIZE,
|
||||
VM_MIN_ADDRESS,
|
||||
VM_MAXUSER_ADDRESS,
|
||||
USRSTACK,
|
||||
PS_STRINGS,
|
||||
VM_PROT_ALL,
|
||||
exec_copyout_strings,
|
||||
exec_linux_setregs,
|
||||
NULL
|
||||
.sv_size = LINUX_SYS_MAXSYSCALL,
|
||||
.sv_table = linux_sysent,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = LINUX_SIGTBLSZ,
|
||||
.sv_sigtbl = bsd_to_linux_signal,
|
||||
.sv_errsize = ELAST + 1,
|
||||
.sv_errtbl = bsd_to_linux_errno,
|
||||
.sv_transtrap = translate_traps,
|
||||
.sv_fixup = elf_linux_fixup,
|
||||
.sv_sendsig = linux_sendsig,
|
||||
.sv_sigcode = linux_sigcode,
|
||||
.sv_szsigcode = &linux_szsigcode,
|
||||
.sv_prepsyscall = linux_prepsyscall,
|
||||
.sv_name = "Linux ELF",
|
||||
.sv_coredump = elf32_coredump,
|
||||
.sv_imgact_try = exec_linux_imgact_try,
|
||||
.sv_minsigstksz = LINUX_MINSIGSTKSZ,
|
||||
.sv_pagesize = PAGE_SIZE,
|
||||
.sv_minuser = VM_MIN_ADDRESS,
|
||||
.sv_maxuser = VM_MAXUSER_ADDRESS,
|
||||
.sv_usrstack = USRSTACK,
|
||||
.sv_psstrings = PS_STRINGS,
|
||||
.sv_stackprot = VM_PROT_ALL,
|
||||
.sv_copyout_strings = exec_copyout_strings,
|
||||
.sv_setregs = exec_linux_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL
|
||||
};
|
||||
|
||||
static Elf32_Brandinfo linux_brand = {
|
||||
ELFOSABI_LINUX,
|
||||
EM_386,
|
||||
"Linux",
|
||||
"/compat/linux",
|
||||
"/lib/ld-linux.so.1",
|
||||
&elf_linux_sysvec,
|
||||
NULL,
|
||||
BI_CAN_EXEC_DYN,
|
||||
};
|
||||
.brand = ELFOSABI_LINUX,
|
||||
.machine = EM_386,
|
||||
.compat_3_brand = "Linux",
|
||||
.emul_path = "/compat/linux",
|
||||
.interp_path = "/lib/ld-linux.so.1",
|
||||
.sysvec = &elf_linux_sysvec,
|
||||
.interp_newpath = NULL,
|
||||
.flags = BI_CAN_EXEC_DYN,
|
||||
};
|
||||
|
||||
static Elf32_Brandinfo linux_glibc2brand = {
|
||||
ELFOSABI_LINUX,
|
||||
EM_386,
|
||||
"Linux",
|
||||
"/compat/linux",
|
||||
"/lib/ld-linux.so.2",
|
||||
&elf_linux_sysvec,
|
||||
NULL,
|
||||
BI_CAN_EXEC_DYN,
|
||||
};
|
||||
.brand = ELFOSABI_LINUX,
|
||||
.machine = EM_386,
|
||||
.compat_3_brand = "Linux",
|
||||
.emul_path = "/compat/linux",
|
||||
.interp_path = "/lib/ld-linux.so.2",
|
||||
.sysvec = &elf_linux_sysvec,
|
||||
.interp_newpath = NULL,
|
||||
.flags = BI_CAN_EXEC_DYN,
|
||||
};
|
||||
|
||||
Elf32_Brandinfo *linux_brandlist[] = {
|
||||
&linux_brand,
|
||||
&linux_glibc2brand,
|
||||
NULL
|
||||
};
|
||||
&linux_brand,
|
||||
&linux_glibc2brand,
|
||||
NULL
|
||||
};
|
||||
|
||||
static int
|
||||
linux_elf_modevent(module_t mod, int type, void *data)
|
||||
|
@ -54,56 +54,57 @@ Elf_Addr link_elf_get_gp(linker_file_t);
|
||||
extern Elf_Addr fptr_storage[];
|
||||
|
||||
struct sysentvec elf64_freebsd_sysvec = {
|
||||
SYS_MAXSYSCALL,
|
||||
sysent,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
__elfN(freebsd_fixup),
|
||||
sendsig,
|
||||
NULL, /* sigcode */
|
||||
NULL, /* &szsigcode */
|
||||
NULL,
|
||||
"FreeBSD ELF64",
|
||||
__elfN(coredump),
|
||||
NULL,
|
||||
MINSIGSTKSZ,
|
||||
PAGE_SIZE,
|
||||
VM_MIN_ADDRESS,
|
||||
VM_MAXUSER_ADDRESS,
|
||||
USRSTACK,
|
||||
PS_STRINGS,
|
||||
VM_PROT_READ|VM_PROT_WRITE,
|
||||
exec_copyout_strings,
|
||||
exec_setregs,
|
||||
NULL
|
||||
.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,
|
||||
.sv_fixup = __elfN(freebsd_fixup),
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = NULL,
|
||||
.sv_szsigcode = NULL,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD ELF64",
|
||||
.sv_coredump = __elfN(coredump),
|
||||
.sv_imgact_try = NULL,
|
||||
.sv_minsigstksz = MINSIGSTKSZ,
|
||||
.sv_pagesize = PAGE_SIZE,
|
||||
.sv_minuser = VM_MIN_ADDRESS,
|
||||
.sv_maxuser = VM_MAXUSER_ADDRESS,
|
||||
.sv_usrstack = USRSTACK,
|
||||
.sv_psstrings = PS_STRINGS,
|
||||
.sv_stackprot = VM_PROT_READ|VM_PROT_WRITE,
|
||||
.sv_copyout_strings = exec_copyout_strings,
|
||||
.sv_setregs = exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL
|
||||
};
|
||||
|
||||
static Elf64_Brandinfo freebsd_brand_info = {
|
||||
ELFOSABI_FREEBSD,
|
||||
EM_IA_64,
|
||||
"FreeBSD",
|
||||
NULL,
|
||||
"/libexec/ld-elf.so.1",
|
||||
&elf64_freebsd_sysvec,
|
||||
NULL,
|
||||
BI_CAN_EXEC_DYN,
|
||||
.brand = ELFOSABI_FREEBSD,
|
||||
.machine = EM_IA_64,
|
||||
.compat_3_brand = "FreeBSD",
|
||||
.emul_path = NULL,
|
||||
.interp_path = "/libexec/ld-elf.so.1",
|
||||
.sysvec = &elf64_freebsd_sysvec,
|
||||
.interp_newpath = NULL,
|
||||
.flags = BI_CAN_EXEC_DYN,
|
||||
};
|
||||
SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY,
|
||||
(sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_info);
|
||||
|
||||
static Elf64_Brandinfo freebsd_brand_oinfo = {
|
||||
ELFOSABI_FREEBSD,
|
||||
EM_IA_64,
|
||||
"FreeBSD",
|
||||
NULL,
|
||||
"/usr/libexec/ld-elf.so.1",
|
||||
&elf64_freebsd_sysvec,
|
||||
NULL,
|
||||
BI_CAN_EXEC_DYN,
|
||||
.brand = ELFOSABI_FREEBSD,
|
||||
.machine = EM_IA_64,
|
||||
.compat_3_brand = "FreeBSD",
|
||||
.emul_path = NULL,
|
||||
.interp_path = "/usr/libexec/ld-elf.so.1",
|
||||
.sysvec = &elf64_freebsd_sysvec,
|
||||
.interp_newpath = NULL,
|
||||
.flags = BI_CAN_EXEC_DYN,
|
||||
};
|
||||
SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY,
|
||||
(sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_oinfo);
|
||||
|
@ -56,32 +56,33 @@ static int exec_aout_imgact(struct image_params *imgp);
|
||||
static int aout_fixup(register_t **stack_base, struct image_params *imgp);
|
||||
|
||||
struct sysentvec aout_sysvec = {
|
||||
SYS_MAXSYSCALL,
|
||||
sysent,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
aout_fixup,
|
||||
sendsig,
|
||||
sigcode,
|
||||
&szsigcode,
|
||||
NULL,
|
||||
"FreeBSD a.out",
|
||||
NULL,
|
||||
NULL,
|
||||
MINSIGSTKSZ,
|
||||
PAGE_SIZE,
|
||||
VM_MIN_ADDRESS,
|
||||
VM_MAXUSER_ADDRESS,
|
||||
USRSTACK,
|
||||
PS_STRINGS,
|
||||
VM_PROT_ALL,
|
||||
exec_copyout_strings,
|
||||
exec_setregs,
|
||||
NULL
|
||||
.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,
|
||||
.sv_fixup = aout_fixup,
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = sigcode,
|
||||
.sv_szsigcode = &szsigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD a.out",
|
||||
.sv_coredump = NULL,
|
||||
.sv_imgact_try = NULL,
|
||||
.sv_minsigstksz = MINSIGSTKSZ,
|
||||
.sv_pagesize = PAGE_SIZE,
|
||||
.sv_minuser = VM_MIN_ADDRESS,
|
||||
.sv_maxuser = VM_MAXUSER_ADDRESS,
|
||||
.sv_usrstack = USRSTACK,
|
||||
.sv_psstrings = PS_STRINGS,
|
||||
.sv_stackprot = VM_PROT_ALL,
|
||||
.sv_copyout_strings = exec_copyout_strings,
|
||||
.sv_setregs = exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL
|
||||
};
|
||||
|
||||
static int
|
||||
|
@ -322,32 +322,33 @@ set_boot_verbose(void *data __unused)
|
||||
SYSINIT(boot_verbose, SI_SUB_TUNABLES, SI_ORDER_ANY, set_boot_verbose, NULL);
|
||||
|
||||
struct sysentvec null_sysvec = {
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
"null",
|
||||
NULL,
|
||||
NULL,
|
||||
0,
|
||||
PAGE_SIZE,
|
||||
VM_MIN_ADDRESS,
|
||||
VM_MAXUSER_ADDRESS,
|
||||
USRSTACK,
|
||||
PS_STRINGS,
|
||||
VM_PROT_ALL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
.sv_size = 0,
|
||||
.sv_table = NULL,
|
||||
.sv_mask = 0,
|
||||
.sv_sigsize = 0,
|
||||
.sv_sigtbl = NULL,
|
||||
.sv_errsize = 0,
|
||||
.sv_errtbl = NULL,
|
||||
.sv_transtrap = NULL,
|
||||
.sv_fixup = NULL,
|
||||
.sv_sendsig = NULL,
|
||||
.sv_sigcode = NULL,
|
||||
.sv_szsigcode = NULL,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "null",
|
||||
.sv_coredump = NULL,
|
||||
.sv_imgact_try = NULL,
|
||||
.sv_minsigstksz = 0,
|
||||
.sv_pagesize = PAGE_SIZE,
|
||||
.sv_minuser = VM_MIN_ADDRESS,
|
||||
.sv_maxuser = VM_MAXUSER_ADDRESS,
|
||||
.sv_usrstack = USRSTACK,
|
||||
.sv_psstrings = PS_STRINGS,
|
||||
.sv_stackprot = VM_PROT_ALL,
|
||||
.sv_copyout_strings = NULL,
|
||||
.sv_setregs = NULL,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -48,57 +48,60 @@ __FBSDID("$FreeBSD$");
|
||||
#include <machine/md_var.h>
|
||||
|
||||
struct sysentvec elf32_freebsd_sysvec = {
|
||||
SYS_MAXSYSCALL,
|
||||
sysent,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
__elfN(freebsd_fixup),
|
||||
sendsig,
|
||||
sigcode,
|
||||
&szsigcode,
|
||||
NULL,
|
||||
"FreeBSD ELF32",
|
||||
__elfN(coredump),
|
||||
NULL,
|
||||
MINSIGSTKSZ,
|
||||
PAGE_SIZE,
|
||||
VM_MIN_ADDRESS,
|
||||
VM_MAXUSER_ADDRESS,
|
||||
USRSTACK,
|
||||
PS_STRINGS,
|
||||
VM_PROT_ALL,
|
||||
exec_copyout_strings,
|
||||
exec_setregs,
|
||||
NULL
|
||||
.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,
|
||||
.sv_fixup = __elfN(freebsd_fixup),
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = sigcode,
|
||||
.sv_szsigcode = &szsigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD ELF32",
|
||||
.sv_coredump = __elfN(coredump),
|
||||
.sv_imgact_try = NULL,
|
||||
.sv_minsigstksz = MINSIGSTKSZ,
|
||||
.sv_pagesize = PAGE_SIZE,
|
||||
.sv_minuser = VM_MIN_ADDRESS,
|
||||
.sv_maxuser = VM_MAXUSER_ADDRESS,
|
||||
.sv_usrstack = USRSTACK,
|
||||
.sv_psstrings = PS_STRINGS,
|
||||
.sv_stackprot = VM_PROT_ALL,
|
||||
.sv_copyout_strings = exec_copyout_strings,
|
||||
.sv_setregs = exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL
|
||||
};
|
||||
|
||||
static Elf32_Brandinfo freebsd_brand_info = {
|
||||
ELFOSABI_FREEBSD,
|
||||
EM_MIPS,
|
||||
"FreeBSD",
|
||||
NULL,
|
||||
"/libexec/ld-elf.so.1",
|
||||
&elf32_freebsd_sysvec,
|
||||
NULL,
|
||||
};
|
||||
.brand = ELFOSABI_FREEBSD,
|
||||
.machine = EM_MIPS,
|
||||
.compat_3_brand = "FreeBSD",
|
||||
.emul_path = NULL,
|
||||
.interp_path = "/libexec/ld-elf.so.1",
|
||||
.sysvec = &elf32_freebsd_sysvec,
|
||||
.interp_newpath = NULL,
|
||||
.flags = 0
|
||||
};
|
||||
|
||||
SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY,
|
||||
(sysinit_cfunc_t) elf32_insert_brand_entry,
|
||||
&freebsd_brand_info);
|
||||
(sysinit_cfunc_t) elf32_insert_brand_entry,
|
||||
&freebsd_brand_info);
|
||||
|
||||
static Elf32_Brandinfo freebsd_brand_oinfo = {
|
||||
ELFOSABI_FREEBSD,
|
||||
EM_MIPS,
|
||||
"FreeBSD",
|
||||
NULL,
|
||||
"/usr/libexec/ld-elf.so.1",
|
||||
&elf32_freebsd_sysvec,
|
||||
NULL,
|
||||
};
|
||||
.brand = ELFOSABI_FREEBSD,
|
||||
.machine = EM_MIPS,
|
||||
.compat_3_brand = "FreeBSD",
|
||||
.emul_path = NULL,
|
||||
.interp_path = "/usr/libexec/ld-elf.so.1",
|
||||
.sysvec = &elf32_freebsd_sysvec,
|
||||
.interp_newpath = NULL,
|
||||
.flags = 0
|
||||
};
|
||||
|
||||
SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY,
|
||||
(sysinit_cfunc_t) elf32_insert_brand_entry,
|
||||
|
@ -49,59 +49,60 @@
|
||||
#include <machine/md_var.h>
|
||||
|
||||
struct sysentvec elf32_freebsd_sysvec = {
|
||||
SYS_MAXSYSCALL,
|
||||
sysent,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
__elfN(freebsd_fixup),
|
||||
sendsig,
|
||||
sigcode,
|
||||
&szsigcode,
|
||||
NULL,
|
||||
"FreeBSD ELF32",
|
||||
__elfN(coredump),
|
||||
NULL,
|
||||
MINSIGSTKSZ,
|
||||
PAGE_SIZE,
|
||||
VM_MIN_ADDRESS,
|
||||
VM_MAXUSER_ADDRESS,
|
||||
USRSTACK,
|
||||
PS_STRINGS,
|
||||
VM_PROT_ALL,
|
||||
exec_copyout_strings,
|
||||
exec_setregs,
|
||||
NULL
|
||||
.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,
|
||||
.sv_fixup = __elfN(freebsd_fixup),
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = sigcode,
|
||||
.sv_szsigcode = &szsigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD ELF32",
|
||||
.sv_coredump = __elfN(coredump),
|
||||
.sv_imgact_try = NULL,
|
||||
.sv_minsigstksz = MINSIGSTKSZ,
|
||||
.sv_pagesize = PAGE_SIZE,
|
||||
.sv_minuser = VM_MIN_ADDRESS,
|
||||
.sv_maxuser = VM_MAXUSER_ADDRESS,
|
||||
.sv_usrstack = USRSTACK,
|
||||
.sv_psstrings = PS_STRINGS,
|
||||
.sv_stackprot = VM_PROT_ALL,
|
||||
.sv_copyout_strings = exec_copyout_strings,
|
||||
.sv_setregs = exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL
|
||||
};
|
||||
|
||||
static Elf32_Brandinfo freebsd_brand_info = {
|
||||
ELFOSABI_FREEBSD,
|
||||
EM_PPC,
|
||||
"FreeBSD",
|
||||
NULL,
|
||||
"/libexec/ld-elf.so.1",
|
||||
&elf32_freebsd_sysvec,
|
||||
NULL,
|
||||
BI_CAN_EXEC_DYN,
|
||||
};
|
||||
.brand = ELFOSABI_FREEBSD,
|
||||
.machine = EM_PPC,
|
||||
.compat_3_brand = "FreeBSD",
|
||||
.emul_path = NULL,
|
||||
.interp_path = "/libexec/ld-elf.so.1",
|
||||
.sysvec = &elf32_freebsd_sysvec,
|
||||
.interp_newpath = NULL,
|
||||
.flags = BI_CAN_EXEC_DYN,
|
||||
};
|
||||
|
||||
SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY,
|
||||
(sysinit_cfunc_t) elf32_insert_brand_entry,
|
||||
&freebsd_brand_info);
|
||||
(sysinit_cfunc_t) elf32_insert_brand_entry,
|
||||
&freebsd_brand_info);
|
||||
|
||||
static Elf32_Brandinfo freebsd_brand_oinfo = {
|
||||
ELFOSABI_FREEBSD,
|
||||
EM_PPC,
|
||||
"FreeBSD",
|
||||
NULL,
|
||||
"/usr/libexec/ld-elf.so.1",
|
||||
&elf32_freebsd_sysvec,
|
||||
NULL,
|
||||
BI_CAN_EXEC_DYN,
|
||||
};
|
||||
.brand = ELFOSABI_FREEBSD,
|
||||
.machine = EM_PPC,
|
||||
.compat_3_brand = "FreeBSD",
|
||||
.emul_path = NULL,
|
||||
.interp_path = "/usr/libexec/ld-elf.so.1",
|
||||
.sysvec = &elf32_freebsd_sysvec,
|
||||
.interp_newpath = NULL,
|
||||
.flags = BI_CAN_EXEC_DYN,
|
||||
};
|
||||
|
||||
SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY,
|
||||
(sysinit_cfunc_t) elf32_insert_brand_entry,
|
||||
|
@ -61,59 +61,60 @@ __FBSDID("$FreeBSD$");
|
||||
#include "linker_if.h"
|
||||
|
||||
static struct sysentvec elf64_freebsd_sysvec = {
|
||||
SYS_MAXSYSCALL,
|
||||
sysent,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
__elfN(freebsd_fixup),
|
||||
sendsig,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
"FreeBSD ELF64",
|
||||
__elfN(coredump),
|
||||
NULL,
|
||||
MINSIGSTKSZ,
|
||||
PAGE_SIZE,
|
||||
VM_MIN_ADDRESS,
|
||||
VM_MAXUSER_ADDRESS,
|
||||
USRSTACK,
|
||||
PS_STRINGS,
|
||||
VM_PROT_READ | VM_PROT_WRITE,
|
||||
exec_copyout_strings,
|
||||
exec_setregs,
|
||||
NULL
|
||||
.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,
|
||||
.sv_fixup = __elfN(freebsd_fixup),
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = NULL,
|
||||
.sv_szsigcode = NULL,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "FreeBSD ELF64",
|
||||
.sv_coredump = __elfN(coredump),
|
||||
.sv_imgact_try = NULL,
|
||||
.sv_minsigstksz = MINSIGSTKSZ,
|
||||
.sv_pagesize = PAGE_SIZE,
|
||||
.sv_minuser = VM_MIN_ADDRESS,
|
||||
.sv_maxuser = VM_MAXUSER_ADDRESS,
|
||||
.sv_usrstack = USRSTACK,
|
||||
.sv_psstrings = PS_STRINGS,
|
||||
.sv_stackprot = VM_PROT_READ | VM_PROT_WRITE,
|
||||
.sv_copyout_strings = exec_copyout_strings,
|
||||
.sv_setregs = exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL
|
||||
};
|
||||
|
||||
static Elf64_Brandinfo freebsd_brand_info = {
|
||||
ELFOSABI_FREEBSD,
|
||||
EM_SPARCV9,
|
||||
"FreeBSD",
|
||||
NULL,
|
||||
"/libexec/ld-elf.so.1",
|
||||
&elf64_freebsd_sysvec,
|
||||
NULL,
|
||||
BI_CAN_EXEC_DYN,
|
||||
};
|
||||
.brand = ELFOSABI_FREEBSD,
|
||||
.machine = EM_SPARCV9,
|
||||
.compat_3_brand = "FreeBSD",
|
||||
.emul_path = NULL,
|
||||
.interp_path = "/libexec/ld-elf.so.1",
|
||||
.sysvec = &elf64_freebsd_sysvec,
|
||||
.interp_newpath = NULL,
|
||||
.flags = BI_CAN_EXEC_DYN,
|
||||
};
|
||||
|
||||
SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY,
|
||||
(sysinit_cfunc_t) elf64_insert_brand_entry,
|
||||
&freebsd_brand_info);
|
||||
(sysinit_cfunc_t) elf64_insert_brand_entry,
|
||||
&freebsd_brand_info);
|
||||
|
||||
static Elf64_Brandinfo freebsd_brand_oinfo = {
|
||||
ELFOSABI_FREEBSD,
|
||||
EM_SPARCV9,
|
||||
"FreeBSD",
|
||||
NULL,
|
||||
"/usr/libexec/ld-elf.so.1",
|
||||
&elf64_freebsd_sysvec,
|
||||
NULL,
|
||||
BI_CAN_EXEC_DYN,
|
||||
};
|
||||
.brand = ELFOSABI_FREEBSD,
|
||||
.machine = EM_SPARCV9,
|
||||
.compat_3_brand = "FreeBSD",
|
||||
.emul_path = NULL,
|
||||
.interp_path = "/usr/libexec/ld-elf.so.1",
|
||||
.sysvec = &elf64_freebsd_sysvec,
|
||||
.interp_newpath = NULL,
|
||||
.flags = BI_CAN_EXEC_DYN,
|
||||
};
|
||||
|
||||
SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY,
|
||||
(sysinit_cfunc_t) elf64_insert_brand_entry,
|
||||
|
Loading…
Reference in New Issue
Block a user