blob: 8d3b0d447498d6d236dfb95c079b606c6a41e461 [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
78 PERCPU_SECTION(L1_CACHE_BYTES)
79
80 /*
81 * .exit.text is discard at runtime, not link time, to deal with
82 * references from .debug_frame
83 * It will be init freed, being inside [__init_start : __init_end]
84 */
85 .exit.text : { EXIT_TEXT }
86 .exit.data : { EXIT_DATA }
87
88 . = ALIGN(PAGE_SIZE);
89 __init_end = .;
90
91 .text : {
92 _text = .;
93 TEXT_TEXT
94 SCHED_TEXT
95 LOCK_TEXT
96 KPROBES_TEXT
97 *(.fixup)
98 *(.gnu.warning)
99 }
100 EXCEPTION_TABLE(L1_CACHE_BYTES)
101 _etext = .;
102
103 _sdata = .;
104 RO_DATA_SECTION(PAGE_SIZE)
105
106 /*
107 * 1. this is .data essentially
108 * 2. THREAD_SIZE for init.task, must be kernel-stk sz aligned
109 */
110 RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
111
112 _edata = .;
113
114 BSS_SECTION(0, 0, 0)
115
Vineet Gupta854a0d92013-01-22 17:03:19 +0530116#ifdef CONFIG_ARC_DW2_UNWIND
117 . = ALIGN(PAGE_SIZE);
118 .debug_frame : {
119 __start_unwind = .;
120 *(.debug_frame)
121 __end_unwind = .;
122 }
123#else
124 /DISCARD/ : { *(.debug_frame) }
125#endif
126
Vineet Guptacfdbc2e2013-01-18 15:12:20 +0530127 NOTES
128
129 . = ALIGN(PAGE_SIZE);
130 _end = . ;
131
132 STABS_DEBUG
Vineet Guptacfdbc2e2013-01-18 15:12:20 +0530133 DISCARDS
134
135 .arcextmap 0 : {
136 *(.gnu.linkonce.arcextmap.*)
137 *(.arcextmap.*)
138 }
Vineet Gupta854a0d92013-01-22 17:03:19 +0530139
140 /* open-coded because we need .debug_frame seperately for unwinding */
141 .debug_aranges 0 : { *(.debug_aranges) }
142 .debug_pubnames 0 : { *(.debug_pubnames) }
143 .debug_info 0 : { *(.debug_info) }
144 .debug_abbrev 0 : { *(.debug_abbrev) }
145 .debug_line 0 : { *(.debug_line) }
146 .debug_str 0 : { *(.debug_str) }
147 .debug_loc 0 : { *(.debug_loc) }
148 .debug_macinfo 0 : { *(.debug_macinfo) }
149
Vineet Gupta8b5850f2013-01-18 15:12:25 +0530150#ifdef CONFIG_ARC_HAS_DCCM
151 . = CONFIG_ARC_DCCM_BASE;
152 __arc_dccm_base = .;
153 .data.arcfp : {
154 *(.data.arcfp)
155 }
156 . = ALIGN(CONFIG_ARC_DCCM_SZ * 1024);
157#endif
Vineet Guptacfdbc2e2013-01-18 15:12:20 +0530158}