| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
 | 2 |  * This file is subject to the terms and conditions of the GNU General Public | 
 | 3 |  * License.  See the file "COPYING" in the main directory of this archive | 
 | 4 |  * for more details. | 
 | 5 |  * | 
 | 6 |  * arch/sh5/vmlinux.lds.S | 
 | 7 |  * | 
 | 8 |  * ld script to make ST50 Linux kernel | 
 | 9 |  * | 
 | 10 |  * Copyright (C) 2000, 2001  Paolo Alberelli | 
 | 11 |  * | 
 | 12 |  * benedict.gaster@superh.com:	 2nd May 2002 | 
 | 13 |  *    Add definition of empty_zero_page to be the first page of kernel image. | 
 | 14 |  * | 
 | 15 |  * benedict.gaster@superh.com:	 3rd May 2002 | 
 | 16 |  *    Added support for ramdisk, removing statically linked romfs at the same time. | 
 | 17 |  * | 
 | 18 |  * lethal@linux-sh.org:          9th May 2003 | 
 | 19 |  *    Kill off GLOBAL_NAME() usage and other CDC-isms. | 
 | 20 |  * | 
 | 21 |  * lethal@linux-sh.org:         19th May 2003 | 
 | 22 |  *    Remove support for ancient toolchains. | 
 | 23 |  */ | 
 | 24 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | #include <asm/page.h> | 
 | 26 | #include <asm/cache.h> | 
 | 27 | #include <asm/processor.h> | 
 | 28 | #include <asm/thread_info.h> | 
 | 29 |  | 
 | 30 | #define LOAD_OFFSET	CONFIG_CACHED_MEMORY_OFFSET | 
 | 31 | #include <asm-generic/vmlinux.lds.h> | 
 | 32 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | OUTPUT_ARCH(sh:sh5) | 
 | 34 |  | 
 | 35 | #define C_PHYS(x) AT (ADDR(x) - LOAD_OFFSET) | 
 | 36 |  | 
 | 37 | ENTRY(__start) | 
 | 38 | SECTIONS | 
 | 39 | { | 
 | 40 |   . = CONFIG_CACHED_MEMORY_OFFSET + CONFIG_MEMORY_START + PAGE_SIZE; | 
 | 41 |   _text = .;			/* Text and read-only data */ | 
 | 42 |   text = .;			/* Text and read-only data */ | 
 | 43 |  | 
 | 44 |   .empty_zero_page : C_PHYS(.empty_zero_page) { | 
 | 45 | 	*(.empty_zero_page) | 
 | 46 | 	} = 0 | 
 | 47 |  | 
 | 48 |   .text : C_PHYS(.text) { | 
| Paul Mundt | 5698200 | 2007-07-20 17:45:05 +0900 | [diff] [blame] | 49 |   	*(.text.head) | 
| Sam Ravnborg | 7664709 | 2007-05-13 00:31:33 +0200 | [diff] [blame] | 50 | 	TEXT_TEXT | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | 	*(.text64) | 
 | 52 |         *(.text..SHmedia32) | 
 | 53 | 	SCHED_TEXT | 
 | 54 | 	LOCK_TEXT | 
 | 55 | 	*(.fixup) | 
 | 56 | 	*(.gnu.warning) | 
 | 57 | #ifdef CONFIG_LITTLE_ENDIAN | 
 | 58 | 	} = 0x6ff0fff0 | 
 | 59 | #else | 
 | 60 | 	} = 0xf0fff06f | 
 | 61 | #endif | 
 | 62 |  | 
 | 63 |   /* We likely want __ex_table to be Cache Line aligned */ | 
 | 64 |   . = ALIGN(L1_CACHE_BYTES);		/* Exception table */ | 
 | 65 |   __start___ex_table = .; | 
 | 66 |   __ex_table : C_PHYS(__ex_table) { *(__ex_table) } | 
 | 67 |   __stop___ex_table = .; | 
 | 68 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 |   _etext = .;			/* End of text section */ | 
 | 70 |  | 
| Paul Mundt | 3f7a0ce | 2007-10-09 15:53:16 +0900 | [diff] [blame] | 71 |   NOTES  | 
 | 72 |  | 
 | 73 |   RODATA | 
 | 74 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 |   .data : C_PHYS(.data) {			/* Data */ | 
| Sam Ravnborg | ca96725 | 2007-05-17 13:38:44 +0200 | [diff] [blame] | 76 | 	DATA_DATA | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 77 | 	CONSTRUCTORS | 
 | 78 | 	} | 
 | 79 |  | 
 | 80 |   . = ALIGN(PAGE_SIZE); | 
 | 81 |   .data.page_aligned : C_PHYS(.data.page_aligned) { *(.data.page_aligned) } | 
 | 82 |  | 
| Paul Mundt | 3f7a0ce | 2007-10-09 15:53:16 +0900 | [diff] [blame] | 83 |   PERCPU(PAGE_SIZE) | 
 | 84 |  | 
 | 85 |   . = ALIGN(L1_CACHE_BYTES); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 86 |   .data.cacheline_aligned : C_PHYS(.data.cacheline_aligned) { *(.data.cacheline_aligned) } | 
 | 87 |  | 
 | 88 |   _edata = .;			/* End of data section */ | 
 | 89 |  | 
 | 90 |   . = ALIGN(THREAD_SIZE);	/* init_task: structure size aligned */ | 
 | 91 |   .data.init_task : C_PHYS(.data.init_task) { *(.data.init_task) } | 
 | 92 |  | 
 | 93 |   . = ALIGN(PAGE_SIZE);		/* Init code and data */ | 
 | 94 |   __init_begin = .; | 
 | 95 |   _sinittext = .; | 
 | 96 |   .init.text : C_PHYS(.init.text) { *(.init.text) } | 
 | 97 |   _einittext = .; | 
 | 98 |   .init.data : C_PHYS(.init.data) { *(.init.data) } | 
 | 99 |   . = ALIGN(L1_CACHE_BYTES);	/* Better if Cache Line aligned */ | 
 | 100 |   __setup_start = .; | 
 | 101 |   .init.setup : C_PHYS(.init.setup) { *(.init.setup) } | 
 | 102 |   __setup_end = .; | 
 | 103 |   __initcall_start = .; | 
 | 104 |   .initcall.init : C_PHYS(.initcall.init) { | 
| Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 105 | 	INITCALLS | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 106 |   } | 
 | 107 |   __initcall_end = .; | 
 | 108 |   __con_initcall_start = .; | 
 | 109 |   .con_initcall.init : C_PHYS(.con_initcall.init) { *(.con_initcall.init) } | 
 | 110 |   __con_initcall_end = .; | 
 | 111 |   SECURITY_INIT | 
| Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 112 |  | 
 | 113 | #ifdef CONFIG_BLK_DEV_INITRD | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 |   __initramfs_start = .; | 
 | 115 |   .init.ramfs : C_PHYS(.init.ramfs) { *(.init.ramfs) } | 
 | 116 |   __initramfs_end = .; | 
| Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 117 | #endif | 
 | 118 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 119 |   . = ALIGN(PAGE_SIZE); | 
 | 120 |   __init_end = .; | 
 | 121 |  | 
 | 122 |   /* Align to the biggest single data representation, head and tail */ | 
 | 123 |   . = ALIGN(8); | 
 | 124 |   __bss_start = .;		/* BSS */ | 
 | 125 |   .bss : C_PHYS(.bss) { | 
 | 126 | 	*(.bss) | 
 | 127 | 	} | 
 | 128 |   . = ALIGN(8); | 
 | 129 |   _end = . ; | 
 | 130 |  | 
 | 131 |   /* Sections to be discarded */ | 
 | 132 |   /DISCARD/ : { | 
 | 133 | 	*(.exit.text) | 
 | 134 | 	*(.exit.data) | 
 | 135 | 	*(.exitcall.exit) | 
 | 136 | 	} | 
 | 137 |  | 
| Paul Mundt | 3f7a0ce | 2007-10-09 15:53:16 +0900 | [diff] [blame] | 138 |   STABS_DEBUG | 
 | 139 |   DWARF_DEBUG | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 140 | } |