Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 17 Jun 2002 20:16:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 17 Jun 2002 20:16:05 -0400 Received: from pixpat.austin.ibm.com ([192.35.232.241]:37296 "EHLO wagner.rustcorp.com.au") by vger.kernel.org with ESMTP id ; Mon, 17 Jun 2002 20:16:03 -0400 From: Rusty Russell To: Kai Germaschewski Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] Initcall depends In-reply-to: Your message of "Mon, 17 Jun 2002 17:43:11 EST." Date: Tue, 18 Jun 2002 10:17:10 +1000 Message-Id: Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1971 Lines: 51 In message 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/