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