From owner-freebsd-hackers Mon Nov 6 23:07:55 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id XAA06044 for hackers-outgoing; Mon, 6 Nov 1995 23:07:55 -0800 Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id XAA06039 for ; Mon, 6 Nov 1995 23:07:50 -0800 Received: from msmith@localhost by genesis.atrad.adelaide.edu.au (8.6.12/8.6.9) id HAA03407 for hackers@freebsd.org; Tue, 7 Nov 1995 07:02:18 GMT From: Michael Smith Message-Id: <199511070702.HAA03407@genesis.atrad.adelaide.edu.au> Subject: Linux emul, QMAGIC libs To: hackers@freebsd.org Date: Tue, 7 Nov 1995 07:02:17 +0000 () MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1860 Sender: owner-hackers@freebsd.org Precedence: bulk Just wasting my time 8) pottering through the Linux emulator, wondering about why QMAGIC format libraries don't work. I find some interesting discrepancies 8( Linux emulation uses the standard kernel execve, but its own code for shared libraries : /* * Set file/virtual offset based on a.out variant. */ switch ((int)(a_out->a_magic & 0xffff)) { case 0413: /* ZMAGIC */ virtual_offset = 0; file_offset = 1024; break; case 0314: /* QMAGIC */ virtual_offset = 4096; file_offset = 0; break; default: return ENOEXEC; } This conflicts with /sys/kern/imgact_aout.c : (NBPG = 1<<12) - pruned /* * Set file/virtual offset based on a.out variant. */ switch ((int)(a_out->a_magic & 0xffff)) { case ZMAGIC: virtual_offset = 0; if (a_out->a_text) { file_offset = NBPG; } else { /* Bill's "screwball mode" */ file_offset = 0; } break; case QMAGIC: virtual_offset = NBPG; file_offset = 0; break; However, if this was all there was to it, QMAGIC would work, but ZMAGIC wouldn't. Any ideas? Obviously, the kernel gets it right (most of the time; this doesn't explain the failure of a QMAGIC ld.so 8), but how linux_misc manages... I'm puzzled. -- ]] Mike Smith, Software Engineer msmith@atrad.adelaide.edu.au [[ ]] Genesis Software genesis@atrad.adelaide.edu.au [[ ]] High-speed data acquisition and [[ ]] realtime instrument control (ph/fax) +61-8-267-3039 [[ ]] My car has "demand start" -Terry Lambert UNIX: live FreeBSD or die! [[