svn commit: r194629 - head/sys/net

Bruce Evans brde at optusnet.com.au
Tue Jun 23 02:39:22 UTC 2009


On Mon, 22 Jun 2009, Bjoern A. Zeeb wrote:

> On Mon, 22 Jun 2009, Bjoern A. Zeeb wrote:
>> Log:
>>  Collect all VIMAGE_GLOBALS variables in one place.
>> 
>>  No longer export rt_tables as all lookups go through
>>  rt_tables_get_rnh().
>> 
>>  We cannot make rt_tables (and rtstat, rttrash[1]) static as
>>  netstat -r (-rs[1]) would stop working on a stripped
>>  VIMAGE_GLOBALS kernel.

We can do this.

>> 
>>  Reviewed by:		zec
>>  Presumably broken by:	phk 13.5y ago in r12820 [1]
>
> Which seriously leads to the questions:
> 1) is this because we do not ship stripped kernels?

It shouldn't be:
- we shouldn't try to break all utilities that use nlist() on kernels by
   shipping stripped kernels
- we shouldn't try to break some utilities that use nlist() on kernels by
   shipping kernels with only static symbols stripped.  Static symbols are
   public except at the level of compiling.

> 2) is the kvm_* interface to read them the wrong way?

It's the easiest way, and should still work even if the values are
exported by sysctls, since it is the only way that works on dead
kernels.

Maybe netstat is looking up the wrong symbols.

Maybe this is a gcc bug.  gcc now leaves out static symbols that it
thinhs are not used at the level of compiling.  An example might be a
pointer that is initialized at compile time but not used except by kvm
and debuggers (not to mention nm to check that it has not been removed),
or even a non-volatile pointer that is initialized at runtime but not
used except by kvm, etc.  gcc now also leaves out static functions
that are called only once, after inlining them.  This probably doesn't
affect kvm, but it breaks profiling and debugging.  There are various
attributes and compiler flags to prevent these bugs, but these are not
used everywhere necessary.

> 3) those stats are useless and should be garbage collected entirely?
>
> I only tripped over this because I wanted to do the same to rt_tables
> as phk did 13.5 years back to rtstat,rttrash and Marko made me
> tripple check things.

Bruce


More information about the svn-src-all mailing list