diff options
Diffstat (limited to 'arch/sh/kernel/vmlinux.lds.S')
| -rw-r--r-- | arch/sh/kernel/vmlinux.lds.S | 160 |
1 files changed, 61 insertions, 99 deletions
diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S index 9cb95af7b09..db88cbf9eaf 100644 --- a/arch/sh/kernel/vmlinux.lds.S +++ b/arch/sh/kernel/vmlinux.lds.S @@ -1,125 +1,87 @@ -/* $Id: vmlinux.lds.S,v 1.8 2003/05/16 17:18:14 lethal Exp $ +/* * ld script to make SuperH Linux kernel - * Written by Niibe Yutaka + * Written by Niibe Yutaka and Paul Mundt */ +#ifdef CONFIG_SUPERH64 +#define LOAD_OFFSET PAGE_OFFSET +OUTPUT_ARCH(sh:sh5) +#else +#define LOAD_OFFSET 0 +OUTPUT_ARCH(sh) +#endif + #include <asm/thread_info.h> #include <asm/cache.h> -#include <asm-generic/vmlinux.lds.h> +#include <asm/vmlinux.lds.h> -#ifdef CONFIG_CPU_LITTLE_ENDIAN -OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux") +#ifdef CONFIG_PMB + #define MEMORY_OFFSET 0 #else -OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux") + #define MEMORY_OFFSET __MEMORY_START #endif -OUTPUT_ARCH(sh) + ENTRY(_start) SECTIONS { - . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET; - _text = .; /* Text and read-only data */ - text = .; /* Text and read-only data */ - .empty_zero_page : { - *(.empty_zero_page) - } = 0 - .text : { - *(.text.head) - TEXT_TEXT - SCHED_TEXT - LOCK_TEXT - *(.fixup) - *(.gnu.warning) - } = 0x0009 + . = PAGE_OFFSET + MEMORY_OFFSET + PHYSICAL_OFFSET + CONFIG_ZERO_PAGE_OFFSET; - . = ALIGN(16); /* Exception table */ - __start___ex_table = .; - __ex_table : { *(__ex_table) } - __stop___ex_table = .; + _text = .; /* Text and read-only data */ - _etext = .; /* End of text section */ + .empty_zero_page : AT(ADDR(.empty_zero_page) - LOAD_OFFSET) { + *(.empty_zero_page) + } = 0 + + .text : AT(ADDR(.text) - LOAD_OFFSET) { + HEAD_TEXT + TEXT_TEXT + EXTRA_TEXT + SCHED_TEXT + LOCK_TEXT + KPROBES_TEXT + IRQENTRY_TEXT + *(.fixup) + *(.gnu.warning) + _etext = .; /* End of text section */ + } = 0x0009 - RODATA + EXCEPTION_TABLE(16) + NOTES - BUG_TABLE + _sdata = .; + RO_DATA(PAGE_SIZE) + RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) + _edata = .; - .data : { /* Data */ - DATA_DATA + DWARF_EH_FRAME - /* Align the initial ramdisk image (INITRD) on page boundaries. */ - . = ALIGN(PAGE_SIZE); - __rd_start = .; - *(.initrd) - . = ALIGN(PAGE_SIZE); - __rd_end = .; + . = ALIGN(PAGE_SIZE); /* Init code and data */ + __init_begin = .; + INIT_TEXT_SECTION(PAGE_SIZE) + INIT_DATA_SECTION(16) - CONSTRUCTORS + . = ALIGN(4); + .machvec.init : AT(ADDR(.machvec.init) - LOAD_OFFSET) { + __machvec_start = .; + *(.machvec.init) + __machvec_end = .; } - . = ALIGN(PAGE_SIZE); - .data.page_aligned : { *(.data.page_aligned) } - __nosave_begin = .; - .data_nosave : { *(.data.nosave) } - . = ALIGN(PAGE_SIZE); - __nosave_end = .; - - PERCPU(PAGE_SIZE) - .data.cacheline_aligned : { *(.data.cacheline_aligned) } - - _edata = .; /* End of data section */ - - . = ALIGN(THREAD_SIZE); /* init_task */ - .data.init_task : { *(.data.init_task) } - - . = ALIGN(PAGE_SIZE); /* Init code and data */ - __init_begin = .; - _sinittext = .; - .init.text : { *(.init.text) } - _einittext = .; - .init.data : { *(.init.data) } - . = ALIGN(16); - __setup_start = .; - .init.setup : { *(.init.setup) } - __setup_end = .; - __initcall_start = .; - .initcall.init : { - INITCALLS - } - __initcall_end = .; - __con_initcall_start = .; - .con_initcall.init : { *(.con_initcall.init) } - __con_initcall_end = .; - SECURITY_INIT - -#ifdef CONFIG_BLK_DEV_INITRD - __initramfs_start = .; - .init.ramfs : { *(.init.ramfs) } - __initramfs_end = .; -#endif + PERCPU_SECTION(L1_CACHE_BYTES) - . = ALIGN(4); - __machvec_start = .; - .machvec.init : { *(.machvec.init) } - __machvec_end = .; + /* + * .exit.text is discarded at runtime, not link time, to deal with + * references from __bug_table + */ + .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { EXIT_TEXT } + .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { EXIT_DATA } - . = ALIGN(PAGE_SIZE); - .bss : { + . = ALIGN(PAGE_SIZE); __init_end = .; - __bss_start = .; /* BSS */ - *(.bss.page_aligned) - *(.bss) - . = ALIGN(4); + BSS_SECTION(0, PAGE_SIZE, 4) _end = . ; - } - - /* When something in the kernel is NOT compiled as a module, the - * module cleanup code and data are put into these segments. Both - * can then be thrown away, as cleanup code is never called unless - * it's a module. - */ - /DISCARD/ : { - *(.exitcall.exit) - } - STABS_DEBUG + STABS_DEBUG + DWARF_DEBUG - DWARF_DEBUG + DISCARDS } |
