• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * ld script for the c6x kernel
3 *
4 *  Copyright (C) 2010, 2011 Texas Instruments Incorporated
5 *  Mark Salter <msalter@redhat.com>
6 */
7#include <asm-generic/vmlinux.lds.h>
8#include <asm/thread_info.h>
9#include <asm/page.h>
10
11ENTRY(_c_int00)
12
13#if defined(CONFIG_CPU_BIG_ENDIAN)
14jiffies = jiffies_64 + 4;
15#else
16jiffies = jiffies_64;
17#endif
18
19#define	READONLY_SEGMENT_START	\
20	. = PAGE_OFFSET;
21#define	READWRITE_SEGMENT_START	\
22	. = ALIGN(128);		\
23	_data_lma = .;
24
25SECTIONS
26{
27	/*
28	 * Start kernel read only segment
29	 */
30	READONLY_SEGMENT_START
31
32	.vectors :
33	{
34		_vectors_start = .;
35		*(.vectors)
36		. = ALIGN(0x400);
37		_vectors_end = .;
38	}
39
40	/*
41	 * This section contains data which may be shared with other
42	 * cores. It needs to be a fixed offset from PAGE_OFFSET
43	 * regardless of kernel configuration.
44	 */
45	.virtio_ipc_dev :
46	{
47		*(.virtio_ipc_dev)
48	}
49
50	. = ALIGN(PAGE_SIZE);
51	__init_begin = .;
52	.init :
53	{
54		_sinittext = .;
55		HEAD_TEXT
56		INIT_TEXT
57		_einittext = .;
58	}
59
60	INIT_DATA_SECTION(16)
61
62	PERCPU_SECTION(128)
63
64	. = ALIGN(PAGE_SIZE);
65	__init_end = .;
66
67	.text :
68	{
69		_text = .;
70		_stext = .;
71		TEXT_TEXT
72		SCHED_TEXT
73		CPUIDLE_TEXT
74		LOCK_TEXT
75		IRQENTRY_TEXT
76		SOFTIRQENTRY_TEXT
77		KPROBES_TEXT
78		*(.fixup)
79		*(.gnu.warning)
80	}
81
82	EXCEPTION_TABLE(16)
83	NOTES
84
85	RO_DATA_SECTION(PAGE_SIZE)
86	.const :
87	{
88		*(.const .const.* .gnu.linkonce.r.*)
89		*(.switch)
90	}
91
92	. = ALIGN (8) ;
93	__fdt_blob : AT(ADDR(__fdt_blob) - LOAD_OFFSET)
94	{
95		_fdt_start = . ;	/* place for fdt blob */
96		*(__fdt_blob) ;		/* Any link-placed DTB */
97		BYTE(0);		/* section always has contents */
98	        . = _fdt_start + 0x4000;	/* Pad up to 16kbyte */
99		_fdt_end = . ;
100	}
101
102	_etext = .;
103
104	/*
105	 * Start kernel read-write segment.
106	 */
107	READWRITE_SEGMENT_START
108	_sdata = .;
109
110	.fardata : AT(ADDR(.fardata) - LOAD_OFFSET)
111	{
112		INIT_TASK_DATA(THREAD_SIZE)
113		NOSAVE_DATA
114		PAGE_ALIGNED_DATA(PAGE_SIZE)
115		CACHELINE_ALIGNED_DATA(128)
116		READ_MOSTLY_DATA(128)
117		DATA_DATA
118		CONSTRUCTORS
119		*(.data1)
120		*(.fardata .fardata.*)
121		*(.data.debug_bpt)
122	}
123
124	.neardata ALIGN(8) : AT(ADDR(.neardata) - LOAD_OFFSET)
125	{
126		*(.neardata2 .neardata2.* .gnu.linkonce.s2.*)
127		*(.neardata .neardata.* .gnu.linkonce.s.*)
128		. = ALIGN(8);
129	}
130
131	_edata = .;
132
133	__bss_start = .;
134	SBSS(8)
135	BSS(8)
136	.far :
137	{
138		. = ALIGN(8);
139		*(.dynfar)
140		*(.far .far.* .gnu.linkonce.b.*)
141		. = ALIGN(8);
142	}
143	__bss_stop = .;
144
145	_end = .;
146
147	DWARF_DEBUG
148
149	/DISCARD/ :
150	{
151		  EXIT_TEXT
152		  EXIT_DATA
153		  EXIT_CALL
154		  *(.discard)
155		  *(.discard.*)
156		  *(.interp)
157	}
158}
159