From owner-freebsd-emulation Mon Nov 15 1:25:54 1999 Delivered-To: freebsd-emulation@freebsd.org Received: from mail.scc.nl (node1374.a2000.nl [62.108.19.116]) by hub.freebsd.org (Postfix) with ESMTP id 5337D14F98 for ; Mon, 15 Nov 1999 01:25:51 -0800 (PST) (envelope-from freebsd-emulation@scc.nl) Received: (from daemon@localhost) by mail.scc.nl (8.9.3/8.9.3) id JAA09272 for emulation@FreeBSD.org; Mon, 15 Nov 1999 09:58:21 +0100 (CET) (envelope-from freebsd-emulation@scc.nl) Received: from GATEWAY by dwarf.hq.scc.nl with netnews for emulation@FreeBSD.org (emulation@FreeBSD.org) To: emulation@FreeBSD.org Date: Mon, 15 Nov 1999 09:58:10 +0100 From: Marcel Moolenaar Message-ID: <382FCB22.BED6D32E@scc.nl> Organization: SCC vof Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit References: <199911150151.UAA01121@dreamscape.com> Subject: Re: unbranded, static linux binaries Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org "Mark W. Krentel" wrote: > > I think the linux emulation has a problem with linux binaries that are > unbranded and compiled statically. They run, but only after being > branded type Linux. Unbranded, I get "ELF binary type not known." It's actually not the Linuxulator that has the problem. When the kernel loads a binary (say, your a.out "Hello, world" program) it has to figure out what kind of binary it is (eg what ABI). When the binary was linked dynamicly, the kernel uses the information about the dynamic linker to find that out, but static binaries don't have that. There's basicly nothing in a static binary (other than the branding) that tells the kernel if it's FreeBSD, Linux, SCO etc etc. Static FreeBSD binaries have a branding, but static Linux binaries not. So, the kernel (being safe) tells you that. In -current there's a default branding, which means that if a static binary doesn't have a branding, it is assumed to be equal to the default branding. I good feature when used with care! On -stable you simply have to brand the binary first. > % file a.out > a.out: ELF 32-bit LSB executable, Intel 80386, version 1, > statically linked, not stripped [snip] > % brandelf -t Linux a.out Doing ``file a.out'' after branding would give you something like: a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (Linux), statically linked, stripped -- Marcel Moolenaar mailto:marcel@scc.nl SCC Internetworking & Databases http://www.scc.nl/ The FreeBSD project mailto:marcel@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message