tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: link-sets in modules



On Tue, 29 May 2012, David Laight wrote:

I'm not at all sure ld uses a linker script for 'ld -r' - so you can't
add symbols that way.
No reason why the module loader can't generate them though.

But really you need the module loader be able to request the contents
of the linkset be processed by code in the main kernel (eg to get
sysctls or event counters added).

Well, at least for sysctl's SYSCTL_SETUP() stuff, you probably don't want to use the same initialization call for modules as is used for built-ins. The built-ins are initialized with an explicit NULL argument passed for the sysctl_clog argument, which makes it difficult for a module to do its clean-up. Modular code needs to (or at least, should?) pass a non-null module-specific clog so it can be used during an "undo" at MODULE_CMD_UNLOAD time.

JMHO ...



-------------------------------------------------------------------------
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index