On Fri, 18 Feb 2000, Ruslan Ermilov wrote:

> 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?

RCS file: /home/ncvs/src/lib/libkvm/kvm_file.c,v
Working file: kvm_file.c
head: 1.10
...
----------------------------
revision 1.9
date: 1999/12/27 07:14:57;  author: peter;  state: Exp;  lines: +5 -0
Use kldsym(2) to lookup symbol values.  This avoids the kvm_mkdb juggling
and is module aware.  Yes, this means that kvm_nlist(3) will find symbols
in loaded modules.  The emulation of the nlist struct is pretty crude but
seems to work well enough for all the users in the tree that I found.
----------------------------

> On Mon, Feb 07, 2000 at 10:14:29PM +0800, Peter Wemm wrote:

> > 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.

The former would be a very incorrect fix.  C linkage shouldn't be weakened
to work around deficiencies in binary utilities.

Bruce



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

Reply via email to