Re: More linker magic..

Andi Kleen (ak@muc.de)
Tue, 3 Aug 1999 22:16:13 +0200


On Tue, Aug 03, 1999 at 09:59:56PM +0200, Linus Torvalds wrote:
> - within each priority, the linking order can be used to sub-prioritize.

Which means people will use it, which leads to what you fear, just
mysteriously hidden in the Makefiles.

> It's not that the old scheme didn't work. It worked fine. It just wasn't
> very pretty. The new scheme should be able to remove the ugly parts, it's
> not meant to completely supplant the old regular initialization sequence.

What do you think about cleaning up the other ugly part (aimed at 2.6, the
no driver changes mandate for 2.4 conflicts with it of course):

Modular and compiled in drivers use different initialisation mechanisms
(which leads to subtle bugs all the time).

So:

Making -DMODULE the default for the drivers/* driver.
Use some linker trick to turn init/cleanup_module into a private symbol
and reference it in some table.
Do the dependency resolution modprobe does at link time.
Link it in.
Call the init_modules at boot time via the preconstructed table (independent
of the simple init mechanism you just introduced)
Globally kill all #ifdef MODULE

Does this sound like total crap or does it make sense?

I'm not proposing a full fledged kernel linker like BSD or Solaris have, just
some build magic which would amount to a slightly hacked modprobe and some
objcopy magic.

-Andi

-- 
This is like TV. I don't like TV.

- 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/