Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jan 2002 20:39:08 -0800
From:      Mike Smith <msmith@hub.freebsd.org>
To:        current@freebsd.org
Subject:   Re: HEADS UP: module build process changed
Message-ID:  <20020110203908.A58789@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
> 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 majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020110203908.A58789>