From owner-cvs-all Sat Oct 10 03:03:16 1998 Return-Path: Received: (from daemon@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA16591 for cvs-all-outgoing; Sat, 10 Oct 1998 03:03:16 -0700 (PDT) (envelope-from owner-cvs-all) Received: from spinner.netplex.com.au (spinner.netplex.com.au [202.12.86.3]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id DAA16458; Sat, 10 Oct 1998 03:02:08 -0700 (PDT) (envelope-from peter@netplex.com.au) Received: from spinner.netplex.com.au (localhost [127.0.0.1]) by spinner.netplex.com.au (8.9.1/8.9.1/Spinner) with ESMTP id RAA14971; Sat, 10 Oct 1998 17:32:17 +0800 (WST) (envelope-from peter@spinner.netplex.com.au) Message-Id: <199810100932.RAA14971@spinner.netplex.com.au> X-Mailer: exmh version 2.0.2 2/24/98 To: Doug Rabson cc: cvs-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/kern link_aout.c In-reply-to: Your message of "Sat, 10 Oct 1998 10:44:32 +0100." Date: Sat, 10 Oct 1998 17:32:16 +0800 From: Peter Wemm Sender: owner-cvs-all@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Doug Rabson wrote: > On Fri, 9 Oct 1998, Peter Wemm wrote: > > > peter 1998/10/09 16:49:28 PDT > > > > Modified files: > > sys/kern link_aout.c > > Log: > > Updates for KLD backends. > > - symbol_values checks that the symbol is indeed belonging to the > > correct symbol and string table pairs before looking up. (since there > > could be many pairs, and KLD/DDB need to find out). > > - different ops for files versus preload modules - the unload mechanism > > is different. (a preloaded module has to be deleted on unload since > > the in-core image is tainted by relocation and variables used) > > - Do not build an a.out kernel module if we're running on an elf > > kernel. :-) Note that it should theoretically be possible to > > mix a.out and elf KLD modules providing -mno-underscores was used > > to compile it, or some other symbol conversion takes place. > > - Support preload modules (even though /boot/loader doesn't yet) > > - Search the module path when loading files. > > Actually link_aout.c already discards the leading underscore when > searching symbol tables. This was one of the requirements when I wrote it > to allow a transition to ELF without invalidating existing a.out modules. > I think John Polstra suggested it originally (it was a long time ago and > my memory is fading). I noticed that it was doing something like that, but didn't investigate to see exactly what it was doing. The comment about not creating an a.out kernel module is an artifact of the initialization sequence. The boot loader creates a record for the kernel, and *both* link_elf.c and link_aout.c are run. They both see _DYNAMIC and will quite happily create a linker pseudo-file entry called "kernel". It's kinda neat seeing two kernels loaded at once, but I didn't want to think what would happen if the a.out module tried to interpret the elf _DYNAMIC pointer as an a.out object. Both formats are supported and I think both a.out and elf will work simultaniously, apart from any problems with symbol naming. Cheers, -Peter