On Thu, Sep 13, 2012 at 11:26:39PM +0100, Stuart Henderson wrote:
> Seeing this repeatably fail in my current i386 build, the go port hasn't
> changed, anyone have an idea what might be doing it?
As mentioned on icb, the Go linker doesn't set a PT_NOTE segment for
OpenBSD identification like it does for NetBSD executables. However,
it does set EI_OSABI to ELFOSABI_OPENBSD, and it probably wouldn't
hurt for the kernel to skip the PT_NOTE check in that case.
Please try this diff to see if it fixes lang/go. (Sorry, untested.)
Index: exec_elf.c
===================================================================
RCS file: /cvs/src/sys/kern/exec_elf.c,v
retrieving revision 1.88
diff -u -p -r1.88 exec_elf.c
--- exec_elf.c 11 Sep 2012 15:44:19 -0000 1.88
+++ exec_elf.c 13 Sep 2012 23:07:36 -0000
@@ -592,7 +592,8 @@ ELFNAME2(exec,makecmds)(struct proc *p,
* 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)