On Sat, 28 Apr 2012, Joerg Sonnenberger wrote:
On Sat, Apr 28, 2012 at 05:09:16PM +0100, David Laight wrote:
This mechanism only works for modules that are "separate" from the
kernel (loaded via "boot" or from "filesys"). "builtin" modules still
need to use the link_set mechanism.
Shouldn't be that hard to put the contructor list address into a
link_set - that would make it easy to get them called for 'built in'
modules.
It's not even that complicated. Just provide symbols for start and end
of the .ctor / .dtor section. That can be done either using linker
scripts or by prepending / appending a small object like crt* does.
But can you provide symbols for the start/end of each module's portion
of the .ctor / .dtor section? I don't think you can even guarantee that
all contributions for a module would be co-located. And I don't think
you would want to call all contructors for all (built-in) modules at the
same time, so you'd need a way to identify which entries belong to each
module. This is essentially what the link_set mechanism does today -
the net80211 module (and other stuff) each gets its own .ctor section.
-------------------------------------------------------------------------
| 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 |
-------------------------------------------------------------------------