Messages in this thread | | | From | Rusty Russell <> | Subject | Re: [PATCH] Initcall depends | Date | Tue, 18 Jun 2002 10:17:10 +1000 |
| |
In message <Pine.LNX.4.44.0206171658470.22308-100000@chaos.physics.uiowa.edu> y ou write: > Parts of a solution could be (based on yours above). > > o Define KBUILD_OBJECT during the build, which contains the > name of the module the file we're building will/would end up. > > o Use that to rename the __initcall_whatever to > __initcall__module__whatever. > > o Make a symlink tree pointing to the objects that will be linked in > (Basically $(obj-y)) > > o Go through the symlink tree and for all objects which export objects > and have __initcalls, record that relation.
Hmm... how about "put export symbols in __ksymtab in object file even if CONFIG_MODULE=n", just discard them in the final link.
Then build up table from that (we're looking at the objects anyway).
> o For all __initcall__moduleA__ in the objects to be linked into > vmlinux, find the object that defines it in the symlink tree (its name > will be moduleA.o). > > o Find the unresolved symbols in that object moduleA.o. > > o For each unresolved symbol in moduleA.o, if you find the symbol in the > previously recorded pairs of (exported symbols, __initcall__moduleB), > move __initcall_moduleA behind __initcall_moduleB. > > Probably some issues come up when actually trying to do this, but it > sounds doable at least in principle.
I'll have to think some more and see if I can come up with something along these lines.
> > Then again, there's also the possibility of completing initramsfs, making > it mandatory, compiling things always as modules and leaving it to > "depmod" in initramfs to do the right thing.
If that ever happens... 8) Rusty. -- Anyone who quotes me in their sig is an idiot. -- Rusty Russell. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |