summaryrefslogtreecommitdiff
path: root/sys/kern/exec_elf.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-02-10 08:07:21 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-02-10 08:07:21 +0000
commit312b63cab3976ffcb3290a469bbf55b90da4559e (patch)
treec245105e2e3e6c2682cb15f477fec70558a3286c /sys/kern/exec_elf.c
parent46635a71c2421fe5bc67f03ee208a6a43ff7ea17 (diff)
branding support and freebsd elf
Diffstat (limited to 'sys/kern/exec_elf.c')
-rw-r--r--sys/kern/exec_elf.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c
index 6cd23955660..9045261c8e5 100644
--- a/sys/kern/exec_elf.c
+++ b/sys/kern/exec_elf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_elf.c,v 1.23 1999/01/11 05:12:22 millert Exp $ */
+/* $OpenBSD: exec_elf.c,v 1.24 1999/02/10 08:07:20 deraadt Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
@@ -67,19 +67,26 @@
#include <compat/svr4/svr4_exec.h>
#endif
+#ifdef COMPAT_FREEBSD
+#include <compat/freebsd/freebsd_exec.h>
+#endif
+
struct elf_probe_entry {
int (*func) __P((struct proc *, struct exec_package *, char *,
u_long *, u_int8_t *));
int os_mask;
} elf_probes[] = {
+#ifdef COMPAT_FREEBSD
+ { freebsd_elf_probe, OOS_FREEBSD },
+#endif
+#ifdef COMPAT_LINUX
+ { linux_elf_probe, OOS_LINUX },
+#endif
#ifdef COMPAT_SVR4
{ svr4_elf_probe,
1 << OOS_SVR4 | 1 << OOS_ESIX | 1 << OOS_SOLARIS | 1 << OOS_SCO |
1 << OOS_DELL | 1 << OOS_NCR },
#endif
-#ifdef COMPAT_LINUX
- { linux_elf_probe, OOS_LINUX },
-#endif
{ 0, OOS_OPENBSD }
};
@@ -734,4 +741,14 @@ exec_elf_fixup(p, epp)
free((char *)interp, M_TEMP);
return (error);
}
+
+char *
+elf_check_brand(eh)
+ Elf32_Ehdr *eh;
+{
+ if (eh->e_ident[EI_BRAND] == '\0')
+ return (NULL);
+ return (&eh->e_ident[EI_BRAND]);
+}
+
#endif /* _KERN_DO_ELF */