Re: [PATCH] Fix undefined/miscompiled construct in kernel parameters

From: Richard Henderson (rth@twiddle.net)
Date: Sun Jun 15 2003 - 17:56:23 EST


On Sun, Jun 15, 2003 at 07:48:56PM +0200, Roman Zippel wrote:
> Does the patch below work better?
>
> bye, Roman
>
> --- linux/init/main.c 14 Jun 2003 23:01:48 -0000 1.1.1.41
> +++ linux/init/main.c 15 Jun 2003 17:46:16 -0000
> @@ -383,7 +383,7 @@ asmlinkage void __init start_kernel(void
> {
> char * command_line;
> extern char saved_command_line[];
> - extern struct kernel_param __start___param, __stop___param;
> + extern struct kernel_param __start___param[], __stop___param[];
> /*
> * Interrupts are still disabled. Do necessary setups, then
> * enable them
> @@ -403,8 +403,8 @@ asmlinkage void __init start_kernel(void
> build_all_zonelists();
> page_alloc_init();
> printk("Kernel command line: %s\n", saved_command_line);
> - parse_args("Booting kernel", command_line, &__start___param,
> - &__stop___param - &__start___param,
> + parse_args("Booting kernel", command_line, __start___param,
> + __stop___param - __start___param,
> &unknown_bootoption);
> trap_init();
> rcu_init();

Linus, I'd REALLY prefer this patch be applied, even though
the problem turned out to be one of amd64 alignment, which
can be worked around.

Even if struct kernel_param doesn't suffer from .sdata problems,
this formulation is closer to Correct. I'd really prefer that
all such linker-script generated arrays used the [] form, and
not worry about the size of the data object involved.

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



This archive was generated by hypermail 2b29 : Sun Jun 15 2003 - 22:00:43 EST