1/* 2 * ld script to make SuperH Linux kernel 3 * Written by Niibe Yutaka 4 */ 5#include <asm/thread_info.h> 6#include <asm/cache.h> 7#include <asm-generic/vmlinux.lds.h> 8 9#ifdef CONFIG_CPU_LITTLE_ENDIAN 10OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux") 11#else 12OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux") 13#endif 14OUTPUT_ARCH(sh) 15ENTRY(_start) 16SECTIONS 17{ 18#ifdef CONFIG_32BIT 19 . = CONFIG_PAGE_OFFSET + CONFIG_ZERO_PAGE_OFFSET; 20#else 21 . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET; 22#endif 23 24 _text = .; /* Text and read-only data */ 25 26 .empty_zero_page : { 27 *(.empty_zero_page) 28 } = 0 29 30 .text : { 31 *(.text.head) 32 TEXT_TEXT 33 SCHED_TEXT 34 LOCK_TEXT 35 KPROBES_TEXT 36 *(.fixup) 37 *(.gnu.warning) 38 } = 0x0009 39 40 . = ALIGN(16); /* Exception table */ 41 __start___ex_table = .; 42 __ex_table : { *(__ex_table) } 43 __stop___ex_table = .; 44 45 _etext = .; /* End of text section */ 46 47 NOTES 48 RO_DATA(PAGE_SIZE) 49 50 /* 51 * Code which must be executed uncached and the associated data 52 */ 53 . = ALIGN(PAGE_SIZE); 54 __uncached_start = .; 55 .uncached.text : { *(.uncached.text) } 56 .uncached.data : { *(.uncached.data) } 57 __uncached_end = .; 58 59 . = ALIGN(THREAD_SIZE); 60 .data : { /* Data */ 61 *(.data.init_task) 62 63 . = ALIGN(L1_CACHE_BYTES); 64 *(.data.cacheline_aligned) 65 66 . = ALIGN(L1_CACHE_BYTES); 67 *(.data.read_mostly) 68 69 . = ALIGN(PAGE_SIZE); 70 *(.data.page_aligned) 71 72 __nosave_begin = .; 73 *(.data.nosave) 74 . = ALIGN(PAGE_SIZE); 75 __nosave_end = .; 76 77 DATA_DATA 78 CONSTRUCTORS 79 } 80 81 _edata = .; /* End of data section */ 82 83 . = ALIGN(PAGE_SIZE); /* Init code and data */ 84 __init_begin = .; 85 _sinittext = .; 86 .init.text : { INIT_TEXT } 87 _einittext = .; 88 .init.data : { INIT_DATA } 89 90 . = ALIGN(16); 91 __setup_start = .; 92 .init.setup : { *(.init.setup) } 93 __setup_end = .; 94 95 __initcall_start = .; 96 .initcall.init : { 97 INITCALLS 98 } 99 __initcall_end = .; 100 __con_initcall_start = .; 101 .con_initcall.init : { *(.con_initcall.init) } 102 __con_initcall_end = .; 103 104 SECURITY_INIT 105 106#ifdef CONFIG_BLK_DEV_INITRD 107 . = ALIGN(PAGE_SIZE); 108 __initramfs_start = .; 109 .init.ramfs : { *(.init.ramfs) } 110 __initramfs_end = .; 111#endif 112 113 . = ALIGN(4); 114 __machvec_start = .; 115 .machvec.init : { *(.machvec.init) } 116 __machvec_end = .; 117 118 PERCPU(PAGE_SIZE) 119 120 /* 121 * .exit.text is discarded at runtime, not link time, to deal with 122 * references from __bug_table 123 */ 124 .exit.text : { EXIT_TEXT } 125 .exit.data : { EXIT_DATA } 126 127 . = ALIGN(PAGE_SIZE); 128 .bss : { 129 __init_end = .; 130 __bss_start = .; /* BSS */ 131 *(.bss.page_aligned) 132 *(.bss) 133 *(COMMON) 134 . = ALIGN(4); 135 _ebss = .; /* uClinux MTD sucks */ 136 _end = . ; 137 } 138 139 /* 140 * When something in the kernel is NOT compiled as a module, the 141 * module cleanup code and data are put into these segments. Both 142 * can then be thrown away, as cleanup code is never called unless 143 * it's a module. 144 */ 145 /DISCARD/ : { 146 *(.exitcall.exit) 147 } 148 149 STABS_DEBUG 150 DWARF_DEBUG 151} 152