summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorMatthew Dempsky <matthew@cvs.openbsd.org>2012-09-17 17:11:50 +0000
committerMatthew Dempsky <matthew@cvs.openbsd.org>2012-09-17 17:11:50 +0000
commit5815345159fb5bba9a12d2b9f224cc4562f4c04e (patch)
tree43d23959499f500b2bbbe72fb49e44941d04ceef /sys/kern
parent248f631167114ee7004d000b84a2b7d973fc214a (diff)
Recognize executables tagged with ELFOSABI_OPENBSD (such as generated
by the Go linker) as native executables even if they don't contain an OpenBSD PT_NOTE segment. Confirmed to fix Go by sthen ok kettenis, deraadt
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/exec_elf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c
index e827787795d..1550478c8a7 100644
--- a/sys/kern/exec_elf.c
+++ b/sys/kern/exec_elf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_elf.c,v 1.88 2012/09/11 15:44:19 deraadt Exp $ */
+/* $OpenBSD: exec_elf.c,v 1.89 2012/09/17 17:11:49 matthew Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
@@ -592,7 +592,8 @@ ELFNAME2(exec,makecmds)(struct proc *p, struct exec_package *epp)
* set the ep_emul field in the exec package structure.
*/
error = ENOEXEC;
- if (ELFNAME(os_pt_note)(p, epp, epp->ep_hdr, "OpenBSD", 8, 4) != 0) {
+ if (eh->e_ident[EI_OSABI] != ELFOSABI_OPENBSD &&
+ ELFNAME(os_pt_note)(p, epp, epp->ep_hdr, "OpenBSD", 8, 4) != 0) {
for (i = 0; ELFNAME(probes)[i].func != NULL && error; i++)
error = (*ELFNAME(probes)[i].func)(p, epp, interp, &pos);
if (error)