1/*
2 *	vmlinux.lds.S -- master linker script for m68knommu arch
3 *
4 *	(C) Copyright 2002-2012, Greg Ungerer <gerg@snapgear.com>
5 *
6 *	This linker script is equipped to build either ROM loaded or RAM
7 *	run kernels.
8 */
9
10#if defined(CONFIG_RAMKERNEL)
11#define	KTEXT_ADDR	CONFIG_KERNELBASE
12#endif
13#if defined(CONFIG_ROMKERNEL)
14#define	KTEXT_ADDR	CONFIG_ROMSTART
15#define	KDATA_ADDR	CONFIG_KERNELBASE
16#define	LOAD_OFFSET	KDATA_ADDR + (ADDR(.text) + SIZEOF(.text))
17#endif
18
19#include <asm/page.h>
20#include <asm/thread_info.h>
21#include <asm-generic/vmlinux.lds.h>
22
23OUTPUT_ARCH(m68k)
24ENTRY(_start)
25
26jiffies = jiffies_64 + 4;
27
28SECTIONS {
29
30#ifdef CONFIG_ROMVEC
31	. = CONFIG_ROMVEC;
32	.romvec : {
33		__rom_start = .;
34		_romvec = .;
35		*(.romvec)
36		*(.data..initvect)
37	}
38#endif
39
40	. = KTEXT_ADDR;
41
42	_text = .;
43	_stext = .;
44	.text : {
45		HEAD_TEXT
46		TEXT_TEXT
47		SCHED_TEXT
48		CPUIDLE_TEXT
49		LOCK_TEXT
50		*(.fixup)
51		. = ALIGN(16);
52	}
53	_etext = .;
54
55#ifdef KDATA_ADDR
56	. = KDATA_ADDR;
57#endif
58
59	_sdata = .;
60	RO_DATA_SECTION(PAGE_SIZE)
61	RW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE)
62	_edata = .;
63
64	EXCEPTION_TABLE(16)
65	NOTES
66
67	. = ALIGN(PAGE_SIZE);
68	__init_begin = .;
69	INIT_TEXT_SECTION(PAGE_SIZE)
70	INIT_DATA_SECTION(16)
71	PERCPU_SECTION(16)
72	.m68k_fixup : {
73		__start_fixup = .;
74		*(.m68k_fixup)
75		__stop_fixup = .;
76	}
77	.init.data : {
78		. = ALIGN(PAGE_SIZE);
79		__init_end = .;
80	}
81
82	BSS_SECTION(0, 0, 0)
83
84	_end = .;
85
86	STABS_DEBUG
87	.comment 0 : { *(.comment) }
88
89	/* Sections to be discarded */
90	DISCARDS
91}
92
93