Hi!

Why then it works on 3.4-STABLE (booting without loader(8) and
having kvm(3) programs like pstat(8) and top(1) working).
What makes a difference here?

On Sun, Feb 06, 2000 at 09:38:41PM -0500, Garrett Wollman wrote:
> <<On Mon, 7 Feb 2000 00:25:51 +0200, Ruslan Ermilov <[EMAIL PROTECTED]> said:
> 
> > If I boot with loader(8), everything is ok.
> > Ideas?
> 
> loader loads the kernel symbol table; boot2 does not.
> 
> -GAWollman

On Mon, Feb 07, 2000 at 03:22:36PM +1100, Bruce Evans wrote:
> On Mon, 7 Feb 2000, Ruslan Ermilov wrote:
> 
> > If I boot the system without loader(8), e.g. with /boot.config=kernel,
> > or by interrupting boot blocks and typing /kernel, swapinfo(8) fails:
> > 
> > swapinfo: undefined symbol: _numvnodes
> 
> This is because the elf format puts static symbols in an out-of-the-way
> section, and the boot2 stage of the bootstrap loads sections naively.
> Static symbols end up in a place where the kernel linker can't find
> them.  `numvnodes' is a static symbol...  Global symbols are found
> correctly.
> 
> This bug has affected ddb for more than a year.  I don't believe in
> or use loader(8), and have "fixed" the problem in ddb by not using
> the kernel linker for ddb symbol lookup.  This also fixes the
> nonexistence of ddb symbols on booting with -d.
> 
> Bruce

On Mon, Feb 07, 2000 at 10:14:29PM +0800, Peter Wemm wrote:
> Garrett Wollman wrote:
> > <<On Mon, 7 Feb 2000 00:25:51 +0200, Ruslan Ermilov <[EMAIL PROTECTED]> said:
> > 
> > > If I boot with loader(8), everything is ok.
> > > Ideas?
> > 
> > loader loads the kernel symbol table; boot2 does not.
> > 
> > -GAWollman
> 
> More to the point, a non-stripped kernel has *two* symbol tables.  One that
> has the global symbols and is used for dynamic linking, and the other that
> has the debugging info in it including static symbols.  loader(8) goes to a
> great deal of trouble to get the second table - it's very hard to get it
> when reading from a zlib decompression stream that can't be seek'ed.  The ELF
> format defines a convenient 'load segment' table which defines (usually)
> two chunks of the file to be loaded into memory and at what addresses.  The
> verbose symbol table is not part of this, but the global table is and we get
> it for free.
> 
> Anyway, the correct fix is to make numvnodes global or to change it to a
> sysctl.  Nothing that is referred to by the common libkvm applications
> should be static - this warning has been given before.  running a strip on /
> kernel has the same effect as using boot2 - only global symbols are
> accessible.
> 
> Cheers,
> -Peter


-- 
Ruslan Ermilov          Sysadmin and DBA of the
[EMAIL PROTECTED]        United Commercial Bank,
[EMAIL PROTECTED]          FreeBSD committer,
+380.652.247.647        Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to