aboutsummaryrefslogtreecommitdiff
path: root/sys/sparc64
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2002-07-20 02:56:12 +0000
committerPeter Wemm <peter@FreeBSD.org>2002-07-20 02:56:12 +0000
commit3ebc124838799d79bb81993028066939255edfbf (patch)
tree442882c197085f1177ad99039e6387b24c60e44a /sys/sparc64
parent382f95d332eb42a6a06ef585d2855b536978a48d (diff)
downloadsrc-3ebc124838799d79bb81993028066939255edfbf.tar.gz
src-3ebc124838799d79bb81993028066939255edfbf.zip
Infrastructure tweaks to allow having both an Elf32 and an Elf64 executable
handler in the kernel at the same time. Also, allow for the exec_new_vmspace() code to build a different sized vmspace depending on the executable environment. This is a big help for execing i386 binaries on ia64. The ELF exec code grows the ability to map partial pages when there is a page size difference, eg: emulating 4K pages on 8K or 16K hardware pages. Flesh out the i386 emulation support for ia64. At this point, the only binary that I know of that fails is cvsup, because the cvsup runtime tries to execute code in pages not marked executable. Obtained from: dfr (mostly, many tweaks from me).
Notes
Notes: svn path=/head/; revision=100384
Diffstat (limited to 'sys/sparc64')
-rw-r--r--sys/sparc64/sparc64/elf_machdep.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/sys/sparc64/sparc64/elf_machdep.c b/sys/sparc64/sparc64/elf_machdep.c
index 158d12fb65be..21717fcc9fca 100644
--- a/sys/sparc64/sparc64/elf_machdep.c
+++ b/sys/sparc64/sparc64/elf_machdep.c
@@ -40,12 +40,52 @@
*/
#include <sys/param.h>
+#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/linker.h>
+#include <sys/sysent.h>
+#include <sys/imgact_elf.h>
+#include <sys/syscall.h>
+#include <sys/signalvar.h>
+#include <sys/vnode.h>
#include <machine/elf.h>
+#include <machine/md_var.h>
#include "linker_if.h"
+struct sysentvec elf64_freebsd_sysvec = {
+ SYS_MAXSYSCALL,
+ sysent,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ elf64_freebsd_fixup,
+ sendsig,
+ sigcode,
+ &szsigcode,
+ 0,
+ "FreeBSD ELF64",
+ __elfN(coredump),
+ NULL,
+ MINSIGSTKSZ
+};
+
+static Elf64_Brandinfo freebsd_brand_info = {
+ ELFOSABI_FREEBSD,
+ EM_SPARCV9,
+ "FreeBSD",
+ "",
+ "/usr/libexec/ld-elf.so.1",
+ &elf64_freebsd_sysvec
+ };
+
+SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY,
+ (sysinit_cfunc_t) elf64_insert_brand_entry,
+ &freebsd_brand_info);
+
/*
* The following table holds for each relocation type:
* - the width in bits of the memory location the relocation