blob: 622d8b665a687c0b601a38c19fad02272d7d7a97 [file] [log] [blame]
Vineet Guptacfdbc2e2013-01-18 15:12:20 +05301/*
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
15OUTPUT_ARCH(arc)
16ENTRY(_stext)
17
18#ifdef CONFIG_CPU_BIG_ENDIAN
19jiffies = jiffies_64 + 4;
20#else
21jiffies = jiffies_64;
22#endif
23
24SECTIONS
25{
Vineet Gupta8b5850f2013-01-18 15:12:25 +053026 /*
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 Guptacfdbc2e2013-01-18 15:12:20 +053032 . = CONFIG_LINUX_LINK_BASE;
33
34 _int_vec_base_lds = .;
35 .vector : {
36 *(.vector)
37 . = ALIGN(PAGE_SIZE);
38 }
39
Vineet Gupta8b5850f2013-01-18 15:12:25 +053040#ifdef CONFIG_ARC_HAS_ICCM
41 .text.arcfp : {
42 *(.text.arcfp)
43 . = ALIGN(CONFIG_ARC_ICCM_SZ * 1024);
44 }
45#endif
46
Vineet Guptacfdbc2e2013-01-18 15:12:20 +053047 /*
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 Gupta03a6d282013-01-18 15:12:26 +053078 .init.arch.info : {
79 __arch_info_begin = .;
80 *(.arch.info.init)
81 __arch_info_end = .;
82 }
83
Vineet Guptacfdbc2e2013-01-18 15:12:20 +053084 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 Gupta854a0d92013-01-22 17:03:19 +0530122#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 Guptacfdbc2e2013-01-18 15:12:20 +0530133 NOTES
134
135 . = ALIGN(PAGE_SIZE);
136 _end = . ;
137
138 STABS_DEBUG
Vineet Guptacfdbc2e2013-01-18 15:12:20 +0530139 DISCARDS
140
141 .arcextmap 0 : {
142 *(.gnu.linkonce.arcextmap.*)
143 *(.arcextmap.*)
144 }
Vineet Gupta854a0d92013-01-22 17:03:19 +0530145
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 Gupta8b5850f2013-01-18 15:12:25 +0530156#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 Guptacfdbc2e2013-01-18 15:12:20 +0530164}