On 26-Apr-01 Terry Lambert wrote:
> ] The problem is that param.c is *not* included in gensetdefs scope.
> ] Therefore linker set entries (ie: SYSINIT etc) are not executed.  TUNABLE*
> ] entries in param.c are simply not called or used.
> ] 
> ] SYSTEM_OBJS= locore.o setdef0.o vnode_if.o ${OBJS} ioconf.o param.o
> config.o \
> ]         setdef1.o hack.So
> ] ...
> ] setdef0.c setdef1.c setdefs.h: ${OBJS}
> ]         @gensetdefs ${OBJS}
> ] 
> ] param.o is not included in ${OBJS}.  I dont see how this patch can work
> ] as-is.
> Has this changed in -current?
> I'm running on 4.3-RELEASE (now), and it has no problems.
> Are you sure you aren't linking param.o into your kernel anywhere?
> It's the linker that does the magic, not anything else (as you know);
> I can assure you it's running fine on my 4.3 box.

Umm, tunable_int sets up a sysinit to do the setting of the variable.  This
depends on there being a linker set for the sysinit code to see.  Hmmm *checks
link order*.  Ok, param.o is in between setdef0.o and setdef1.o so it does get
included in the linker set ok, but gensetdefs doesn't see it, so the count of
the number of items in a linker set is bogus and invalid.  If the code depends
on that count then the sysinit's in param.o will be ignored.  If the code just
keeps walking down the set until it hits the NULL entry at the end, it will
work.  Hmm, looking at the bubble sort in mi_startup(), it runs until it hits
NULL and doesn't check the linker set count, which is why tunable's in param.c
works, even though it is incorrect.


John Baldwin <[EMAIL PROTECTED]> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

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

Reply via email to