blob: fef0e6d322f107f47ca5c945c109b95af43a11a7 [file] [log] [blame]
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -07001/*
2 * AVR32 linker script for the Linux kernel
3 *
4 * Copyright (C) 2004-2006 Atmel Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#define LOAD_OFFSET 0x00000000
11#include <asm-generic/vmlinux.lds.h>
Haavard Skinnemoen7cf6ac22007-09-17 11:08:28 +020012#include <asm/cache.h>
13#include <asm/thread_info.h>
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070014
15OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
16OUTPUT_ARCH(avr32)
17ENTRY(_start)
18
19/* Big endian */
20jiffies = jiffies_64 + 4;
21
22SECTIONS
23{
24 . = CONFIG_ENTRY_ADDRESS;
25 .init : AT(ADDR(.init) - LOAD_OFFSET) {
26 _stext = .;
27 __init_begin = .;
28 _sinittext = .;
29 *(.text.reset)
30 *(.init.text)
Haavard Skinnemoen623b0352007-03-13 17:59:11 +010031 /*
32 * .exit.text is discarded at runtime, not
33 * link time, to deal with references from
34 * __bug_table
35 */
36 *(.exit.text)
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070037 _einittext = .;
38 . = ALIGN(4);
39 __tagtable_begin = .;
Haavard Skinnemoenb3cfe0c2007-05-09 09:26:18 +020040 *(.taglist.init)
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070041 __tagtable_end = .;
42 *(.init.data)
43 . = ALIGN(16);
44 __setup_start = .;
45 *(.init.setup)
46 __setup_end = .;
47 . = ALIGN(4);
48 __initcall_start = .;
Andrew Morton61ce1ef2006-10-27 11:41:44 -070049 INITCALLS
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070050 __initcall_end = .;
51 __con_initcall_start = .;
52 *(.con_initcall.init)
53 __con_initcall_end = .;
54 __security_initcall_start = .;
55 *(.security_initcall.init)
56 __security_initcall_end = .;
Jean-Paul Saman67d38222007-02-10 01:44:44 -080057#ifdef CONFIG_BLK_DEV_INITRD
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070058 . = ALIGN(32);
59 __initramfs_start = .;
60 *(.init.ramfs)
61 __initramfs_end = .;
Jean-Paul Saman67d38222007-02-10 01:44:44 -080062#endif
Haavard Skinnemoen7cf6ac22007-09-17 11:08:28 +020063 . = ALIGN(PAGE_SIZE);
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070064 __init_end = .;
65 }
66
67 . = ALIGN(8192);
68 .text : AT(ADDR(.text) - LOAD_OFFSET) {
69 _evba = .;
70 _text = .;
71 *(.ex.text)
72 . = 0x50;
73 *(.tlbx.ex.text)
74 . = 0x60;
75 *(.tlbr.ex.text)
76 . = 0x70;
77 *(.tlbw.ex.text)
78 . = 0x100;
79 *(.scall.text)
80 *(.irq.text)
Sam Ravnborg76647092007-05-13 00:31:33 +020081 TEXT_TEXT
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070082 SCHED_TEXT
83 LOCK_TEXT
84 KPROBES_TEXT
85 *(.fixup)
86 *(.gnu.warning)
87 _etext = .;
88 } = 0xd703d703
89
90 . = ALIGN(4);
91 __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
92 __start___ex_table = .;
93 *(__ex_table)
94 __stop___ex_table = .;
95 }
96
Haavard Skinnemoen623b0352007-03-13 17:59:11 +010097 BUG_TABLE
98
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070099 RODATA
100
Haavard Skinnemoen7cf6ac22007-09-17 11:08:28 +0200101 . = ALIGN(THREAD_SIZE);
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -0700102
103 .data : AT(ADDR(.data) - LOAD_OFFSET) {
104 _data = .;
105 _sdata = .;
106 /*
107 * First, the init task union, aligned to an 8K boundary.
108 */
109 *(.data.init_task)
110
111 /* Then, the cacheline aligned data */
Haavard Skinnemoen7cf6ac22007-09-17 11:08:28 +0200112 . = ALIGN(L1_CACHE_BYTES);
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -0700113 *(.data.cacheline_aligned)
114
115 /* And the rest... */
116 *(.data.rel*)
Sam Ravnborgca967252007-05-17 13:38:44 +0200117 DATA_DATA
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -0700118 CONSTRUCTORS
119
120 _edata = .;
121 }
122
123
124 . = ALIGN(8);
125 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
126 __bss_start = .;
127 *(.bss)
128 *(COMMON)
129 . = ALIGN(8);
130 __bss_stop = .;
131 _end = .;
132 }
133
134 /* When something in the kernel is NOT compiled as a module, the module
135 * cleanup code and data are put into these segments. Both can then be
136 * thrown away, as cleanup code is never called unless it's a module.
137 */
138 /DISCARD/ : {
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -0700139 *(.exit.data)
140 *(.exitcall.exit)
141 }
142
143 DWARF_DEBUG
144}