Re: get_module_symbol and 8390.o

Paul Gortmaker (p_gortmaker@yahoo.com)
Tue, 07 Sep 1999 06:18:06 -0400


Michael Elizabeth Chastain wrote:
>
> I am looking at the CONFIG_MODVERSIONS mess, and I have a question
> about this function:

> get_module_symbol(char *modname, char *symname)

> Ok, now for the putative bug. If the 8390 module was compiled with
> CONFIG_MODVERSIONS on, then its public symbols will be decorated with
> "foo_R12345678" style signatures. get_module_symbol doesn't know anything
> about decorations. So, if CONFIG_MODVERSIONS is on, get_module_symbol
> will return "no match", and this clever dynamic loading of 8390.o
> will fail.

The one thing you (may have) missed is that the on demand loading is
disabled by default at the top of 8390.h. The exact same issue you
mention was discussed about a year or so ago. Alan had a patch for
get_module_symbol that limited the name comparison to exclude the
_Rnnnnnnn so things worked, but it never got included (perhaps because I
think rth said at the time that get_module_symbol was an obsolete
function that should die anyway). There were also some unresolved locking
issues wrt modules loading modules and the general opinion was that it
was an interesting trick but probably overkill. So I disabled
demand-loading but left the code in for "educational purposes".

> Is this ringing any "aha!" bells for network driver maintainers?

A searchable linux-kernel archive will have the full "aha" on file ;)

> straightforward, but limited, solution would be to give up get_module_symbol
> and simply allow all these drivers to load the little 8390.o driver
> when they load instead of doing fancy delayed loading.

Things are currently handled ok by depmod/modprobe without using demand
loading. It only helped to get rid of the `unresolved symbol' errors
people got when trying to insmod a driver without 1st loading the 8390.o
module.

> (I got interested in this because I am writing a new CONFIG_MODVERSIONS,
> and this piece of code really puzzled me.)

If get_module_symbol is to be nuked it wouldn't bother me - I can remove
the non used demand loading code that references it. But you should
check that no 3rd party/separately distributed stuff (PCMCIA?) uses it.

Paul.

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/