> In the book "Writing Linux DEvice Drivers", there is a neat bit
> on how Linux does this.  Effectively, they export all symbols
> within the module load if there is no explicit symbol table
> export call, and they export only the symbols that are requested,
> if there is.

I considered this approach, but couldn't work out a tidy way of making
it work for the case where the module is statically compiled into the
kernel.

Effectively, you'd have to parse the linker set out of the .kld file,
then feed it to objcopy to localise the symbols before linking.
There's no reason that, presuming a mechanism like this was devised,
we couldn't dispense with the EXPORT_SYMS declaration and generate the
list automatically, of course.

I'd be happier with something like __attribute__((__export__)) on the
declaration, of course.  I'm also not fond of the "default to export
all symbols" approach, but that's just a detail.

Regards,
Mike

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

Reply via email to