Re: [PATCH v2 2/2] m68k: Cleanup linker scripts using new linker script macros.

From: Geert Uytterhoeven
Date: Sun Sep 27 2009 - 05:58:15 EST


On Wed, Sep 16, 2009 at 18:44, Tim Abbott <tabbott@xxxxxxxxxxx> wrote:
> Signed-off-by: Tim Abbott <tabbott@xxxxxxxxxxx>
> Cc: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
> Cc: Roman Zippel <zippel@xxxxxxxxxxxxxx>
> Cc: linux-m68k@xxxxxxxxxxxxxxxxxxxx
> Cc: Sam Ravnborg <sam@xxxxxxxxxxxx>

This patch must do something wrong, as it now fails to boot on ARAnyM:

| CPU: Double bus fault detected !
| CPU: Halting

Haven't investigated why yet, though...

> ---
> Âarch/m68k/kernel/vmlinux-std.lds Â| Â 53 +++++++-----------------------------
> Âarch/m68k/kernel/vmlinux-sun3.lds | Â 53 +++++++------------------------------
> Â2 files changed, 21 insertions(+), 85 deletions(-)
>
> diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds
> index 47eac19..5927487 100644
> --- a/arch/m68k/kernel/vmlinux-std.lds
> +++ b/arch/m68k/kernel/vmlinux-std.lds
> @@ -2,6 +2,7 @@
>
> Â#include <asm-generic/vmlinux.lds.h>
> Â#include <asm/page.h>
> +#include <asm/thread_info.h>
>
> ÂOUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k")
> ÂOUTPUT_ARCH(m68k)
> @@ -22,73 +23,41 @@ SECTIONS
>
> Â _etext = .; Â Â Â Â Â Â Â Â Â/* End of text section */
>
> - Â. = ALIGN(16); Â Â Â Â Â Â Â /* Exception table */
> - Â__start___ex_table = .;
> - Â__ex_table : { *(__ex_table) }
> - Â__stop___ex_table = .;
> + ÂEXCEPTION_TABLE(16)
>
> Â RODATA
>
> - Â.data : { Â Â Â Â Â Â Â Â Â Â/* Data */
> - Â Â Â DATA_DATA
> - Â Â Â CONSTRUCTORS
> - Â Â Â }
> + ÂRW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE)
>
> - Â. = ALIGN(16);
> - Â.data.cacheline_aligned : { *(.data.cacheline_aligned) }
> -
> - Â.bss : { *(.bss) } Â Â Â Â Â /* BSS */
> + ÂBSS_SECTION(0, 0, 0)
>
> Â _edata = .; Â Â Â Â Â Â Â Â Â/* End of data section */
>
> Â /* will be freed after init */
> Â . = ALIGN(PAGE_SIZE); Â Â Â Â Â Â Â Â/* Init code and data */
> Â __init_begin = .;
> - Â.init.text : {
> - Â Â Â _sinittext = .;
> - Â Â Â INIT_TEXT
> - Â Â Â _einittext = .;
> - Â} :data
> + ÂINIT_TEXT_SECTION(PAGE_SIZE) :data
> + ÂINIT_DATA_SECTION(16)
> Â .init.data : { INIT_DATA }
> - Â. = ALIGN(16);
> - Â__setup_start = .;
> - Â.init.setup : { *(.init.setup) }
> - Â__setup_end = .;
> - Â__initcall_start = .;
> + Â.init.setup : { INIT_SETUP(16) }
> Â .initcall.init : {
> - Â Â Â INITCALLS
> + Â Â Â INIT_CALLS
> Â }
> - Â__initcall_end = .;
> - Â__con_initcall_start = .;
> - Â.con_initcall.init : { *(.con_initcall.init) }
> - Â__con_initcall_end = .;
> + Â.con_initcall.init : { CON_INITCALL }
> Â .m68k_fixup : {
> Â Â Â Â__start_fixup = .;
> Â Â Â Â*(.m68k_fixup)
> Â Â Â Â__stop_fixup = .;
> Â }
> Â SECURITY_INIT
> -#ifdef CONFIG_BLK_DEV_INITRD
> - Â. = ALIGN(8192);
> - Â__initramfs_start = .;
> - Â.init.ramfs : { *(.init.ramfs) }
> - Â__initramfs_end = .;
> -#endif
> + Â.init.ramfs : { INIT_RAM_FS }
> Â NOTES
> Â . = ALIGN(8192);
> Â __init_end = .;
>
> - Â.data.init_task : { *(.data.init_task) } Â Â /* The initial task and kernel stack */
> -
> Â _end = . ;
>
> - Â/* Stabs debugging sections. Â*/
> - Â.stab 0 : { *(.stab) }
> - Â.stabstr 0 : { *(.stabstr) }
> - Â.stab.excl 0 : { *(.stab.excl) }
> - Â.stab.exclstr 0 : { *(.stab.exclstr) }
> - Â.stab.index 0 : { *(.stab.index) }
> - Â.stab.indexstr 0 : { *(.stab.indexstr) }
> + ÂSTABS_DEBUG
> Â .comment 0 : { *(.comment) }
>
> Â /* Sections to be discarded */
> diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
> index 03efaf0..607d214 100644
> --- a/arch/m68k/kernel/vmlinux-sun3.lds
> +++ b/arch/m68k/kernel/vmlinux-sun3.lds
> @@ -2,6 +2,7 @@
>
> Â#include <asm-generic/vmlinux.lds.h>
> Â#include <asm/page.h>
> +#include <asm/thread_info.h>
>
> ÂOUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k")
> ÂOUTPUT_ARCH(m68k)
> @@ -23,14 +24,8 @@ SECTIONS
>
> Â _etext = .; Â Â Â Â Â Â Â Â Â/* End of text section */
>
> - Â.data : { Â Â Â Â Â Â Â Â Â Â/* Data */
> - Â Â Â DATA_DATA
> - Â Â Â CONSTRUCTORS
> - Â Â Â . = ALIGN(16); Â Â Â Â Â/* Exception table */
> - Â Â Â __start___ex_table = .;
> - Â Â Â *(__ex_table)
> - Â Â Â __stop___ex_table = .;
> - Â Â Â } :data
> + ÂEXCEPTION_TABLE(16)
> + ÂRW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE) :data
> Â /* End of data goes *here* so that freeing init code works properly. */
> Â _edata = .;
> Â NOTES
> @@ -38,56 +33,28 @@ SECTIONS
> Â /* will be freed after init */
> Â . = ALIGN(PAGE_SIZE); Â Â Â Â/* Init code and data */
> Â__init_begin = .;
> - Â Â Â .init.text : {
> - Â Â Â Â Â Â Â _sinittext = .;
> - Â Â Â Â Â Â Â INIT_TEXT
> - Â Â Â Â Â Â Â _einittext = .;
> - Â Â Â }
> + Â Â Â INIT_TEXT_SECTION(PAGE_SIZE)
> Â Â Â Â.init.data : { INIT_DATA }
> - Â Â Â . = ALIGN(16);
> - Â Â Â __setup_start = .;
> - Â Â Â .init.setup : { *(.init.setup) }
> - Â Â Â __setup_end = .;
> - Â Â Â __initcall_start = .;
> + Â Â Â .init.setup : { INIT_SETUP(16) }
> Â Â Â Â.initcall.init : {
> - Â Â Â Â Â Â Â INITCALLS
> + Â Â Â Â Â Â Â INIT_CALLS
> Â Â Â Â}
> - Â Â Â __initcall_end = .;
> - Â Â Â __con_initcall_start = .;
> - Â Â Â .con_initcall.init : { *(.con_initcall.init) }
> - Â Â Â __con_initcall_end = .;
> + Â Â Â .con_initcall.init : { CON_INITCALL }
> Â Â Â Â.m68k_fixup : {
> Â Â Â Â Â Â Â Â__start_fixup = .;
> Â Â Â Â Â Â Â Â*(.m68k_fixup)
> Â Â Â Â Â Â Â Â__stop_fixup = .;
> Â Â Â Â}
> Â Â Â ÂSECURITY_INIT
> -#ifdef CONFIG_BLK_DEV_INITRD
> - Â Â Â . = ALIGN(PAGE_SIZE);
> - Â Â Â __initramfs_start = .;
> - Â Â Â .init.ramfs : { *(.init.ramfs) }
> - Â Â Â __initramfs_end = .;
> -#endif
> + Â Â Â .init.ramfs : { INIT_RAM_FS }
> Â Â Â Â. = ALIGN(PAGE_SIZE);
> Â Â Â Â__init_end = .;
> - Â Â Â .data.init.task : { *(.data.init_task) }
> -
>
> - Â.bss : { *(.bss) } Â Â Â Â Â /* BSS */
> + ÂBSS_SECTION(0, 0, 0)
>
> Â _end = . ;
>
> - Â.crap : {
> - Â Â Â /* Stabs debugging sections. Â*/
> - Â Â Â *(.stab)
> - Â Â Â *(.stabstr)
> - Â Â Â *(.stab.excl)
> - Â Â Â *(.stab.exclstr)
> - Â Â Â *(.stab.index)
> - Â Â Â *(.stab.indexstr)
> - Â Â Â *(.comment)
> - Â Â Â *(.note)
> - Â}
> + ÂSTABS_DEBUG
>
> Â /* Sections to be discarded */
> Â DISCARDS
> --
> 1.6.3.3
>
>



--
Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/