2001-10-11 11:46:03

by Keith Owens

[permalink] [raw]
Subject: Modutils 2.5 change, start running this command now

Repeat for anybody who ignored this request the first time.

In current modutils, a module that does not export symbols and does not
say EXPORT_NO_SYMBOLS will default to exporting all symbols. This is a
hangover from kernel 2.0 and will be removed when modutils 2.5 appears,
shortly after the kernel 2.5 branch is created.

Starting with modutils 2.5, modules must explicitly say what their
intention is for symbols. That will break a lot of existing modules.

The command below lists the modules that are compiled on your system
and will be affected. All code maintainers need to run this against
their 2.4 modules and do one of two things. Either export the required
symbols (remember to add the .o file to export-objs in the Makefile) or
add EXPORT_NO_SYMBOLS; somewhere in the module (no change to Makefile).

objdump -h `modprobe -l` | sed -ne '/__ksym/h;$b1;\:^/:!d;:1;x;s/:.*//p;'


2001-10-12 06:34:13

by Ingo Oeser

[permalink] [raw]
Subject: Re: Modutils 2.5 change, start running this command now

On Thu, Oct 11, 2001 at 09:45:58PM +1000, Keith Owens wrote:
> In current modutils, a module that does not export symbols and does not
> say EXPORT_NO_SYMBOLS will default to exporting all symbols. This is a
> hangover from kernel 2.0 and will be removed when modutils 2.5 appears,
> shortly after the kernel 2.5 branch is created.

Will it still be done, if we put it on the "export-objs" list?

Putting an explicit "EXPORT_SYMBOL(foo)" only encourages people
not to look what they can prepend with "static". Everything not
static is the C-definition of "exporting".

EXPORT_SYMBOL is nice, if you have modules consisting of multiple
objects, that need to share variables/functions but should not be
needed, if the module-author knows sth. about proper design.

Regards

Ingo Oeser

2001-10-12 10:04:13

by Benjamin LaHaise

[permalink] [raw]
Subject: Re: Modutils 2.5 change, start running this command now

On Thu, Oct 11, 2001 at 09:45:58PM +1000, Keith Owens wrote:
> In current modutils, a module that does not export symbols and does not
> say EXPORT_NO_SYMBOLS will default to exporting all symbols. This is a
> hangover from kernel 2.0 and will be removed when modutils 2.5 appears,
> shortly after the kernel 2.5 branch is created.
>
> Starting with modutils 2.5, modules must explicitly say what their
> intention is for symbols. That will break a lot of existing modules.

Isn't EXPORT_NO_SYMBOLS the default case for 99.44% of modules? It seems
to me that the lameness incurred in adding an EXPORT_NO_SYMBOLS line to
each and every driver that one writes is a pointless additional hoop to
jump through. I'd rather break the modules that are relying on behaviour
that was deprecated several *years* ago than go through another make-work
project.

-ben

2001-10-12 12:01:37

by Keith Owens

[permalink] [raw]
Subject: Re: Modutils 2.5 change, start running this command now

On Fri, 12 Oct 2001 06:04:20 -0400,
Benjamin LaHaise <[email protected]> wrote:
>On Thu, Oct 11, 2001 at 09:45:58PM +1000, Keith Owens wrote:
>> In current modutils, a module that does not export symbols and does not
>> say EXPORT_NO_SYMBOLS will default to exporting all symbols. This is a
>> hangover from kernel 2.0 and will be removed when modutils 2.5 appears,
>> shortly after the kernel 2.5 branch is created.
>>
>> Starting with modutils 2.5, modules must explicitly say what their
>> intention is for symbols. That will break a lot of existing modules.
>
>Isn't EXPORT_NO_SYMBOLS the default case for 99.44% of modules? It seems
>to me that the lameness incurred in adding an EXPORT_NO_SYMBOLS line to
>each and every driver that one writes is a pointless additional hoop to
>jump through. I'd rather break the modules that are relying on behaviour
>that was deprecated several *years* ago than go through another make-work
>project.

I was going to do it that way. The problem is that it gives no
indication if the module has been checked or not. Adding
EXPORT_NO_SYMBOLS says that somebody has reviewed the module and
decided that exporting no symbols is the correct behaviour. It is the
difference between no maintainer and a maintained module.

2001-10-12 12:15:06

by David Woodhouse

[permalink] [raw]
Subject: Re: Modutils 2.5 change, start running this command now


[email protected] said:
> I was going to do it that way. The problem is that it gives no
> indication if the module has been checked or not. Adding
> EXPORT_NO_SYMBOLS says that somebody has reviewed the module and
> decided that exporting no symbols is the correct behaviour. It is the
> difference between no maintainer and a maintained module.

If all you want to know is whether modules are maintained or not, look to
see how many have had MODULE_LICENSE(sic) tags added.

Just change the default to no exported symbols, and a single depmod pass
will tell you what broke because it's no longer exporting symbols which are
required by something else. There's no need to add the EXPORT_NO_SYMBOLS
cruft all over the place.

Adding EXPORT_NO_SYMBOLS to those modules which don't need to export
symbols doesn't make your task any easier - so please don't do it. Let's
kill EXPORT_NO_SYMBOLS altogether.


--
dwmw2


2001-10-12 14:40:59

by Keith Owens

[permalink] [raw]
Subject: Re: Modutils 2.5 change, start running this command now

On Fri, 12 Oct 2001 13:14:41 +0100,
David Woodhouse <[email protected]> wrote:
>[email protected] said:
>> I was going to do it that way. The problem is that it gives no
>> indication if the module has been checked or not. Adding
>> EXPORT_NO_SYMBOLS says that somebody has reviewed the module and
>> decided that exporting no symbols is the correct behaviour. It is the
>> difference between no maintainer and a maintained module.
>
>Just change the default to no exported symbols, and a single depmod pass
>will tell you what broke because it's no longer exporting symbols which are
>required by something else. There's no need to add the EXPORT_NO_SYMBOLS
>cruft all over the place.

Your approach is "make an incompatible change and see what breaks, then
scramble to fix it". My approach is "get ready for this change so we
can have a clean cutover". Also EXPORT_NO_SYMBOLS is the only way to
clean up 2.4 and 2.2 kernels, there is no option to make an
incompatible change to modutils there.

2001-10-12 15:01:41

by Tom Rini

[permalink] [raw]
Subject: Re: Modutils 2.5 change, start running this command now

On Fri, Oct 12, 2001 at 01:14:41PM +0100, David Woodhouse wrote:
>
> [email protected] said:
> > I was going to do it that way. The problem is that it gives no
> > indication if the module has been checked or not. Adding
> > EXPORT_NO_SYMBOLS says that somebody has reviewed the module and
> > decided that exporting no symbols is the correct behaviour. It is the
> > difference between no maintainer and a maintained module.
>
> If all you want to know is whether modules are maintained or not, look to
> see how many have had MODULE_LICENSE(sic) tags added.

Not really. There's been people auditing the drivers, which is probably
what would happen here. Either way even. Forcing a break will make it
much more obvious is all.

--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

2001-10-15 16:05:33

by Stelian Pop

[permalink] [raw]
Subject: [PATCH] meye camera driver EXPORT_NO_SYMBOLS

On Thu, Oct 11, 2001 at 09:45:58PM +1000, Keith Owens wrote:

> Starting with modutils 2.5, modules must explicitly say what their
> intention is for symbols. That will break a lot of existing modules.

Here is the patch for drivers/media/video/meye.c

Stelian.

diff -uNr --exclude-from=dontdiff linux-2.4.12-ac2.orig/drivers/media/video/meye.c linux-2.4.12-ac2/drivers/media/video/meye.c
--- linux-2.4.12-ac2.orig/drivers/media/video/meye.c Sun Sep 30 21:26:06 2001
+++ linux-2.4.12-ac2/drivers/media/video/meye.c Mon Oct 15 18:01:17 2001
@@ -1482,6 +1482,7 @@
MODULE_DESCRIPTION("video4linux driver for the MotionEye camera");
MODULE_LICENSE("GPL");

+EXPORT_NO_SYMBOLS;

MODULE_PARM(gbuffers,"i");
MODULE_PARM_DESC(gbuffers,"number of capture buffers, default is 2 (32 max)");

--
Stelian Pop <[email protected]>
|---------------- Free Software Engineer -----------------|
| Alc?ve - http://www.alcove.com - Tel: +33 1 49 22 68 00 |
|------------- Alc?ve, liberating software ---------------|