Vineet Gupta | cfdbc2e | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 as |
| 6 | * published by the Free Software Foundation. |
| 7 | */ |
| 8 | |
| 9 | #include <asm-generic/vmlinux.lds.h> |
| 10 | #include <asm/cache.h> |
| 11 | #include <asm/page.h> |
| 12 | #include <asm/thread_info.h> |
| 13 | #include <plat/memmap.h> |
| 14 | |
| 15 | OUTPUT_ARCH(arc) |
| 16 | ENTRY(_stext) |
| 17 | |
| 18 | #ifdef CONFIG_CPU_BIG_ENDIAN |
| 19 | jiffies = jiffies_64 + 4; |
| 20 | #else |
| 21 | jiffies = jiffies_64; |
| 22 | #endif |
| 23 | |
| 24 | SECTIONS |
| 25 | { |
Vineet Gupta | 8b5850f | 2013-01-18 15:12:25 +0530 | [diff] [blame] | 26 | /* |
| 27 | * ICCM starts at 0x8000_0000. So if kernel is relocated to some other |
| 28 | * address, make sure peripheral at 0x8z doesn't clash with ICCM |
| 29 | * Essentially vector is also in ICCM. |
| 30 | */ |
| 31 | |
Vineet Gupta | cfdbc2e | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 32 | . = CONFIG_LINUX_LINK_BASE; |
| 33 | |
| 34 | _int_vec_base_lds = .; |
| 35 | .vector : { |
| 36 | *(.vector) |
| 37 | . = ALIGN(PAGE_SIZE); |
| 38 | } |
| 39 | |
Vineet Gupta | 8b5850f | 2013-01-18 15:12:25 +0530 | [diff] [blame] | 40 | #ifdef CONFIG_ARC_HAS_ICCM |
| 41 | .text.arcfp : { |
| 42 | *(.text.arcfp) |
| 43 | . = ALIGN(CONFIG_ARC_ICCM_SZ * 1024); |
| 44 | } |
| 45 | #endif |
| 46 | |
Vineet Gupta | cfdbc2e | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 47 | /* |
| 48 | * The reason for having a seperate subsection .init.ramfs is to |
| 49 | * prevent objump from including it in kernel dumps |
| 50 | * |
| 51 | * Reason for having .init.ramfs above .init is to make sure that the |
| 52 | * binary blob is tucked away to one side, reducing the displacement |
| 53 | * between .init.text and .text, avoiding any possible relocation |
| 54 | * errors because of calls from .init.text to .text |
| 55 | * Yes such calls do exist. e.g. |
| 56 | * decompress_inflate.c:gunzip( ) -> zlib_inflate_workspace( ) |
| 57 | */ |
| 58 | |
| 59 | __init_begin = .; |
| 60 | |
| 61 | .init.ramfs : { INIT_RAM_FS } |
| 62 | |
| 63 | . = ALIGN(PAGE_SIZE); |
| 64 | _stext = .; |
| 65 | |
| 66 | HEAD_TEXT_SECTION |
| 67 | INIT_TEXT_SECTION(L1_CACHE_BYTES) |
| 68 | |
| 69 | /* INIT_DATA_SECTION open-coded: special INIT_RAM_FS handling */ |
| 70 | .init.data : { |
| 71 | INIT_DATA |
| 72 | INIT_SETUP(L1_CACHE_BYTES) |
| 73 | INIT_CALLS |
| 74 | CON_INITCALL |
| 75 | SECURITY_INITCALL |
| 76 | } |
| 77 | |
Vineet Gupta | 03a6d28 | 2013-01-18 15:12:26 +0530 | [diff] [blame^] | 78 | .init.arch.info : { |
| 79 | __arch_info_begin = .; |
| 80 | *(.arch.info.init) |
| 81 | __arch_info_end = .; |
| 82 | } |
| 83 | |
Vineet Gupta | cfdbc2e | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 84 | PERCPU_SECTION(L1_CACHE_BYTES) |
| 85 | |
| 86 | /* |
| 87 | * .exit.text is discard at runtime, not link time, to deal with |
| 88 | * references from .debug_frame |
| 89 | * It will be init freed, being inside [__init_start : __init_end] |
| 90 | */ |
| 91 | .exit.text : { EXIT_TEXT } |
| 92 | .exit.data : { EXIT_DATA } |
| 93 | |
| 94 | . = ALIGN(PAGE_SIZE); |
| 95 | __init_end = .; |
| 96 | |
| 97 | .text : { |
| 98 | _text = .; |
| 99 | TEXT_TEXT |
| 100 | SCHED_TEXT |
| 101 | LOCK_TEXT |
| 102 | KPROBES_TEXT |
| 103 | *(.fixup) |
| 104 | *(.gnu.warning) |
| 105 | } |
| 106 | EXCEPTION_TABLE(L1_CACHE_BYTES) |
| 107 | _etext = .; |
| 108 | |
| 109 | _sdata = .; |
| 110 | RO_DATA_SECTION(PAGE_SIZE) |
| 111 | |
| 112 | /* |
| 113 | * 1. this is .data essentially |
| 114 | * 2. THREAD_SIZE for init.task, must be kernel-stk sz aligned |
| 115 | */ |
| 116 | RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) |
| 117 | |
| 118 | _edata = .; |
| 119 | |
| 120 | BSS_SECTION(0, 0, 0) |
| 121 | |
Vineet Gupta | 854a0d9 | 2013-01-22 17:03:19 +0530 | [diff] [blame] | 122 | #ifdef CONFIG_ARC_DW2_UNWIND |
| 123 | . = ALIGN(PAGE_SIZE); |
| 124 | .debug_frame : { |
| 125 | __start_unwind = .; |
| 126 | *(.debug_frame) |
| 127 | __end_unwind = .; |
| 128 | } |
| 129 | #else |
| 130 | /DISCARD/ : { *(.debug_frame) } |
| 131 | #endif |
| 132 | |
Vineet Gupta | cfdbc2e | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 133 | NOTES |
| 134 | |
| 135 | . = ALIGN(PAGE_SIZE); |
| 136 | _end = . ; |
| 137 | |
| 138 | STABS_DEBUG |
Vineet Gupta | cfdbc2e | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 139 | DISCARDS |
| 140 | |
| 141 | .arcextmap 0 : { |
| 142 | *(.gnu.linkonce.arcextmap.*) |
| 143 | *(.arcextmap.*) |
| 144 | } |
Vineet Gupta | 854a0d9 | 2013-01-22 17:03:19 +0530 | [diff] [blame] | 145 | |
| 146 | /* open-coded because we need .debug_frame seperately for unwinding */ |
| 147 | .debug_aranges 0 : { *(.debug_aranges) } |
| 148 | .debug_pubnames 0 : { *(.debug_pubnames) } |
| 149 | .debug_info 0 : { *(.debug_info) } |
| 150 | .debug_abbrev 0 : { *(.debug_abbrev) } |
| 151 | .debug_line 0 : { *(.debug_line) } |
| 152 | .debug_str 0 : { *(.debug_str) } |
| 153 | .debug_loc 0 : { *(.debug_loc) } |
| 154 | .debug_macinfo 0 : { *(.debug_macinfo) } |
| 155 | |
Vineet Gupta | 8b5850f | 2013-01-18 15:12:25 +0530 | [diff] [blame] | 156 | #ifdef CONFIG_ARC_HAS_DCCM |
| 157 | . = CONFIG_ARC_DCCM_BASE; |
| 158 | __arc_dccm_base = .; |
| 159 | .data.arcfp : { |
| 160 | *(.data.arcfp) |
| 161 | } |
| 162 | . = ALIGN(CONFIG_ARC_DCCM_SZ * 1024); |
| 163 | #endif |
Vineet Gupta | cfdbc2e | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 164 | } |