From owner-freebsd-arch Wed Feb 28 4:37:27 2001 Delivered-To: freebsd-arch@freebsd.org Received: from mail.wgate.com (mail.wgate.com [38.219.83.4]) by hub.freebsd.org (Postfix) with ESMTP id 896C537B71A for ; Wed, 28 Feb 2001 04:37:23 -0800 (PST) (envelope-from msinz@wgate.com) Received: from sinz.eng.tvol.net ([10.32.2.99]) by mail.wgate.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 152C7CBW; Wed, 28 Feb 2001 07:37:33 -0500 Received: from wgate.com (localhost [127.0.0.1]) by sinz.eng.tvol.net (8.11.1/8.11.1) with ESMTP id f1SCbJk07004; Wed, 28 Feb 2001 07:37:21 -0500 (EST) (envelope-from msinz@wgate.com) Message-ID: <3A9CF0FF.804199EE@wgate.com> Date: Wed, 28 Feb 2001 07:37:19 -0500 From: Michael Sinz Organization: WorldGate Communications Inc. X-Mailer: Mozilla 4.76 [en] (X11; U; FreeBSD 4.2-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: Bruce Evans Cc: "Duane H. Hesser" , Randell Jesup , "(Bruce Bauman)" , Alfred Perlstein , arch@FreeBSD.ORG Subject: Re: ELF and diskless boot References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Bruce Evans wrote: > > On Tue, 27 Feb 2001, Michael Sinz wrote: > > > > On Mon, 13 Mar 2000, Ruslan Ermilov wrote: > > > > > > > One thing that should IMHO be pointed out in the upcoming 4.0-RELEASE's > > > > ERRATA (or some more appropriate place), is the fact that the loader(8) > > > > is now a prerequisite for certain programs using kvm(3) interface. > > > > Obvious examples are top(1) and swapinfo(8). > > > > > > > > If you boot your kernel without loader(8), directly through bootblocks, > > > > these programs will not work. > > > > [I wrote] > > > I don't user loader(8), and finally got around to fixing this. The > > > problem is that the kernel linker wants module data for the kernel. > > > It defaults to using incomplete data if none is present. The following > > > supplies slightly less incomplete data: > > > > [...] > > > > Note that the "using incomplete data" is not really correct. It uses > > complete data -- the dynamic section, aka the publicly defined symbols. > > The problem is that FreeBSD requires the debug symbols. > > It's the module data that is incomplete. My hack doesn't completely fix > this. It only supplies enough data for the kernel linker to see all the > sections that have been loaded. > > No debugging symbols are required, only some static ones. This is > because utilities require almost all symbols to be visible so that > they can be hacked on via kmem (if the kmem hack is used at all). > The publicness of symbols via the kmem hack has very little to do with > their publicness (external linkage) as C symbols or how the symbol > table is organized. It just happens that a.out format made access to > all symbols equally easy. ELF raised the bar, and nonstandard loaders > still haven't all jumped it. The "static" ones are only in the debugging sections (for obvious reasons of the fact that they are not public) The fix you had only works if the kernel has a way to load itself. This does not work for things like Etherboot which does not load the debug symbols (it does load the Elf DYNAMIC section, but that does not have symbols that are not exported) As far as Elf raising the bar goes, it does a better job of separating external vs internal symbols. Making the loaders provide access to all symbols is not the correct solution. The correct solution is to have any symbols that are defined for "external access" to be defined as such. BTW - there is little to prevent a compiler from doing nasty optimizations with variables that are marked "static" since it has full knowledge of the scope of thos variables (or at least it thinks it does since it has been told so in the source) But this is a different issue and does not currently affect GCC/x86 systems for various reasons. -- Michael Sinz ---- Worldgate Communications ---- msinz@wgate.com A master's secrets are only as good as the master's ability to explain them to others. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message