Re: [PATCH] modules as shared objects

Rusty Russell (rusty@rustcorp.com.au)
Mon, 25 Nov 2002 12:10:50 +1100


In message <20021123140128.A699@twiddle.net> you write:
> * Freeing the .init.* sections. Also requires the link script.
> I believe the proper solution is to use a different program
> header with a different load tag:
>
> #define PT_INIT_LOAD 0x60000001
>
> In this way we don't make a mistake and discard a segment that
> we're not supposed to.

Were you thinking of dropping the dynamic at the same time
(ie. putting the dynamic and init sections in the tail using the
linker script)? Hmm, I guess not since you

I think an "mod_arch_free_partial(struct module *mod, void *start,
void *end)" function which archs could use to do whatever fancy magic
they wanted (eg. trim exception and really drop the pages, or your
vmalloc_drop_pages() function, or nothing at all). x86_64, sparc,
sparc64, ppc and arm do/will have their own allocators already.

> +module_core_size(const ElfW(Ehdr) *hdr, struct module *module,

I *really* hate this ElfW(type) notation. I know it's used in
binutils etc, but it's a visual bitch to parse. Please please please
at least use the #defines or typedefs within the generic
kernel/module.c so it's readable.

Other than some gratuitous reformatting 8), looks really good.
Implementing PPC now.

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