Re: [2.6 patch] drivers/message/i2o/iop.c: static inline functions mustn't be exported

From: Adrian Bunk
Date: Wed Apr 19 2006 - 04:33:41 EST


On Tue, Apr 18, 2006 at 11:06:00PM -0700, Andrew Morton wrote:
> Adrian Bunk <bunk@xxxxxxxxx> wrote:
> >
> > static inline functions mustn't be exported.
> >
>
> Actually, exports of static inlines work OK. The compiler will emit an
> out-of-line copy to satisfy EXPORT_SYMBOL's reference and the module
> namespace is separate from the compiler&linker's namespace.
>
> Of course, things will screw up when we're using the compiler&linker
> namespace (ie: the driver is statically linked).
>...

It even works with statically linked drivers.
It does work unless CONFIG_MODULES=n.

But this doesn't mean it's OK - exporting static code is wrong.

BTW:
It seems Patrick's recently merged patch to let the compiler help us
find such bugs (a1a8feed1743ec8d2af1dafa7c5321679f0a3e4f) isn't working.

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

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