Subject: Re: COMPAT_FREEBSD problem
To: Christos Zoulas <christos@zoulas.com>
From: None <collver1@attbi.com>
List: netbsd-help
Date: 11/19/2002 07:14:22
Thank you for your help.

1. ktrace it

   282 ktrace   execve("./example", 0xbfbfd810, 0xbfbfd818) Err#8 ENOEXEC

2. add debugging printfs to exec_elf32.c

It fails with ENOEXEC in exec_elf32.c at ELFNAME2(exec,makecmds) at the
"goto bad;" in the following code snippet.  I am not familiar with this
code, do you have time to give any more hints?

Thanks,

Ben

        /*
         * On the same architecture, we may be emulating different systems.
         * See which one will accept this executable. This currently only
         * applies to SVR4, and IBCS2 on the i386 and Linux on the i386
         * and the Alpha.
         *
         * Probe functions would normally see if the interpreter (if any)
         * exists. Emulation packages may possibly replace the interpreter in
         * interp[] with a changed path (/emul/xxx/<path>).
         */
        if (!epp->ep_esch->u.elf_probe_func) {
                pos = ELFDEFNNAME(NO_ADDR);
        } else {
                vaddr_t startp = 0;

                error = (*epp->ep_esch->u.elf_probe_func)(p, epp, eh, interp,
                                                          &startp);
                pos = (Elf_Addr)startp;
                if (error)
                        goto bad;
        }


On Fri, Nov 15, 2002 at 08:34:31PM +0000, Christos Zoulas wrote:
> 1. ktrace it
> 2. add debugging printfs to exec_elf32.c
> 
> >I have a static linked FreeBSD 4.2 binary that doesn't run under
> >NetBSD/i386 v1.6 with COMPAT_FREEBSD.  Can anyone give me some hints how to
> >troubleshoot it?
> >
> >$ file example
> >example: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
> >FreeBSD 4.2, statically linked, stripped
> >
> >$ ./example
> >./example: 1: Syntax error: "(" unexpected