コード例 #1
0
int
ELFNAME2(linux32,probe)(struct lwp *l, struct exec_package *epp,
			void *eh, char *itp, vaddr_t *pos)
{
	int error;

	if (((error = ELFNAME2(linux,signature)(l, epp, eh, itp)) != 0) &&
#ifdef LINUX32_GCC_SIGNATURE
	    ((error = ELFNAME2(linux,gcc_signature)(l, epp, eh)) != 0) &&
#endif
#ifdef LINUX32_ATEXIT_SIGNATURE
	    ((error = ELFNAME2(linux,atexit_signature)(l, epp, eh)) != 0) &&
#endif
#ifdef LINUX32_DEBUGLINK_SIGNATURE
	    ((error = ELFNAME2(linux,debuglink_signature)(l, epp, eh)) != 0) &&
#endif
	    1)
			return error;

	if (itp) {
		if ((error = emul_find_interp(l, epp, itp)))
			return (error);
	}
#if 0
	DPRINTF(("linux32_probe: returning 0\n"));
#endif

	epp->ep_flags |= EXEC_32 | EXEC_FORCEAUX;
	epp->ep_vm_minaddr = VM_MIN_ADDRESS;
	epp->ep_vm_maxaddr = USRSTACK32;

	return 0;
}
コード例 #2
0
int
ELFNAME2(linux,probe)(struct lwp *l, struct exec_package *epp, void *eh,
                      char *itp, vaddr_t *pos)
{
    int error;

    if (((error = ELFNAME2(linux,signature)(l, epp, eh, itp)) != 0) &&
#ifdef LINUX_GCC_SIGNATURE
            ((error = ELFNAME2(linux,gcc_signature)(l, epp, eh)) != 0) &&
#endif
#ifdef LINUX_ATEXIT_SIGNATURE
            ((error = ELFNAME2(linux,atexit_signature)(l, epp, eh)) != 0) &&
#endif
#ifdef LINUX_DEBUGLINK_SIGNATURE
            ((error = ELFNAME2(linux,debuglink_signature)(l, epp, eh)) != 0) &&
#endif
            1) {
        DPRINTF(("linux_probe: returning %d\n", error));
        return error;
    }

    if (itp) {
        if ((error = emul_find_interp(l, epp, itp)))
            return (error);
    }
    epp->ep_flags |= EXEC_FORCEAUX;
    DPRINTF(("linux_probe: returning 0\n"));
    return 0;
}
コード例 #3
0
int
ELFNAME2(netbsd32,probe)(struct lwp *l, struct exec_package *epp,
			 void *eh, char *itp, vaddr_t *pos)
{
	int error;

	if ((error = ELFNAME2(netbsd,signature)(l, epp, eh)) != 0)
		return error;

#ifdef ELF_MD_PROBE_FUNC
	if ((error = ELF_MD_PROBE_FUNC(l, epp, eh, itp, pos)) != 0)
		return error;
#elif defined(ELF_INTERP_NON_RELOCATABLE)
	*pos = ELF_LINK_ADDR;
#endif

	return ELFNAME2(netbsd32,probe_noteless)(l, epp, eh, itp, pos);
}
コード例 #4
0
ファイル: lkminit_exec.c プロジェクト: MarginC/kame
#include <sys/lkm.h>
#include <sys/signalvar.h>

#include <machine/elf_machdep.h>
#define ELFSIZE	32
#include <sys/exec_elf.h>

#include <compat/freebsd/freebsd_exec.h>

int exec_freebsd_elf_lkmentry __P((struct lkm_table *, int, int));

static struct execsw exec_freebsd_elf =
	/* FreBSD Elf32 (probe not 64-bit safe) */
	{ sizeof (Elf32_Ehdr),
	  exec_elf32_makecmds,
	  { ELFNAME2(freebsd,probe) },
	  NULL,
	  EXECSW_PRIO_ANY,
	  FREEBSD_ELF_AUX_ARGSIZ,
	  elf32_copyargs,
	  NULL,
	  coredump_elf32 };


/*
 * declare the exec
 */
MOD_EXEC("exec_freebsd_elf", -1, &exec_freebsd_elf, "freebsd");

/*
 * entry point
コード例 #5
0
#include <sys/signalvar.h>

#include <machine/elf_machdep.h>
#define ELFSIZE	32
#include <sys/exec_elf.h>

#include <compat/svr4_32/svr4_32_types.h>
#include <compat/svr4_32/svr4_32_exec.h>

int exec_svr4_32_elf_lkmentry(struct lkm_table *, int, int);

static struct execsw exec_svr4_32_elf =
	/* SVR4 Elf32 on 64-bit */
	{ sizeof (Elf_Ehdr),
	  exec_elf32_makecmds,
	  { ELFNAME2(svr4_32,probe) },
	  NULL,
	  EXECSW_PRIO_ANY,
	  SVR4_32_AUX_ARGSIZ,
	  svr4_32_copyargs,
	  NULL,
	  coredump_elf32,
	  exec_setup_stack };

/*
 * declare the exec
 */
MOD_EXEC("exec_svr4_32_elf", -1, &exec_svr4_32_elf, "svr4_32");

/*
 * entry point
コード例 #6
0
ファイル: exec_elf.c プロジェクト: NKSG/INTER_MANET_NS3
struct emul ELFNAMEEND(emul) = {
	"native",
	NULL,
	sendsig,
	SYS_syscall,
	SYS_MAXSYSCALL,
	sysent,
#ifdef SYSCALL_DEBUG
	syscallnames,
#else
	NULL,
#endif
	sizeof (AuxInfo) * ELF_AUX_ENTRIES,
	ELFNAME(copyargs),
	setregs,
	ELFNAME2(exec,fixup),
	sigcode,
	esigcode,
	EMUL_ENABLED | EMUL_NATIVE,
};

/*
 * Copy arguments onto the stack in the normal way, but add some
 * space for extra information in case of dynamic binding.
 */
void *
ELFNAME(copyargs)(struct exec_package *pack, struct ps_strings *arginfo,
		void *stack, void *argp)
{
	stack = copyargs(pack, arginfo, stack, argp);
	if (!stack)