Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 1 | /* |
| 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 Skinnemoen | 7cf6ac2 | 2007-09-17 11:08:28 +0200 | [diff] [blame] | 12 | #include <asm/cache.h> |
| 13 | #include <asm/thread_info.h> |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 14 | |
| 15 | OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32") |
| 16 | OUTPUT_ARCH(avr32) |
| 17 | ENTRY(_start) |
| 18 | |
| 19 | /* Big endian */ |
| 20 | jiffies = jiffies_64 + 4; |
| 21 | |
| 22 | SECTIONS |
| 23 | { |
| 24 | . = CONFIG_ENTRY_ADDRESS; |
| 25 | .init : AT(ADDR(.init) - LOAD_OFFSET) { |
| 26 | _stext = .; |
| 27 | __init_begin = .; |
| 28 | _sinittext = .; |
| 29 | *(.text.reset) |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 30 | INIT_TEXT |
Haavard Skinnemoen | 623b035 | 2007-03-13 17:59:11 +0100 | [diff] [blame] | 31 | /* |
| 32 | * .exit.text is discarded at runtime, not |
| 33 | * link time, to deal with references from |
| 34 | * __bug_table |
| 35 | */ |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 36 | EXIT_TEXT |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 37 | _einittext = .; |
| 38 | . = ALIGN(4); |
| 39 | __tagtable_begin = .; |
Haavard Skinnemoen | b3cfe0c | 2007-05-09 09:26:18 +0200 | [diff] [blame] | 40 | *(.taglist.init) |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 41 | __tagtable_end = .; |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 42 | INIT_DATA |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 43 | . = ALIGN(16); |
| 44 | __setup_start = .; |
| 45 | *(.init.setup) |
| 46 | __setup_end = .; |
| 47 | . = ALIGN(4); |
| 48 | __initcall_start = .; |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 49 | INITCALLS |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 50 | __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 Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 57 | #ifdef CONFIG_BLK_DEV_INITRD |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 58 | . = ALIGN(32); |
| 59 | __initramfs_start = .; |
| 60 | *(.init.ramfs) |
| 61 | __initramfs_end = .; |
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 62 | #endif |
Haavard Skinnemoen | 7cf6ac2 | 2007-09-17 11:08:28 +0200 | [diff] [blame] | 63 | . = ALIGN(PAGE_SIZE); |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 64 | __init_end = .; |
| 65 | } |
| 66 | |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 67 | .text : AT(ADDR(.text) - LOAD_OFFSET) { |
| 68 | _evba = .; |
| 69 | _text = .; |
| 70 | *(.ex.text) |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 71 | *(.irq.text) |
Haavard Skinnemoen | 2507bc1 | 2007-11-28 15:04:01 +0100 | [diff] [blame] | 72 | KPROBES_TEXT |
Sam Ravnborg | 7664709 | 2007-05-13 00:31:33 +0200 | [diff] [blame] | 73 | TEXT_TEXT |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 74 | SCHED_TEXT |
| 75 | LOCK_TEXT |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 76 | *(.fixup) |
| 77 | *(.gnu.warning) |
| 78 | _etext = .; |
| 79 | } = 0xd703d703 |
| 80 | |
| 81 | . = ALIGN(4); |
| 82 | __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { |
| 83 | __start___ex_table = .; |
| 84 | *(__ex_table) |
| 85 | __stop___ex_table = .; |
| 86 | } |
| 87 | |
| 88 | RODATA |
| 89 | |
Haavard Skinnemoen | 7cf6ac2 | 2007-09-17 11:08:28 +0200 | [diff] [blame] | 90 | . = ALIGN(THREAD_SIZE); |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 91 | |
| 92 | .data : AT(ADDR(.data) - LOAD_OFFSET) { |
| 93 | _data = .; |
| 94 | _sdata = .; |
| 95 | /* |
| 96 | * First, the init task union, aligned to an 8K boundary. |
| 97 | */ |
| 98 | *(.data.init_task) |
| 99 | |
Haavard Skinnemoen | cfd23e9 | 2008-01-14 22:15:05 +0100 | [diff] [blame] | 100 | /* Then, the page-aligned data */ |
| 101 | . = ALIGN(PAGE_SIZE); |
| 102 | *(.data.page_aligned) |
| 103 | |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 104 | /* Then, the cacheline aligned data */ |
Haavard Skinnemoen | 7cf6ac2 | 2007-09-17 11:08:28 +0200 | [diff] [blame] | 105 | . = ALIGN(L1_CACHE_BYTES); |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 106 | *(.data.cacheline_aligned) |
| 107 | |
| 108 | /* And the rest... */ |
| 109 | *(.data.rel*) |
Sam Ravnborg | ca96725 | 2007-05-17 13:38:44 +0200 | [diff] [blame] | 110 | DATA_DATA |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 111 | CONSTRUCTORS |
| 112 | |
| 113 | _edata = .; |
| 114 | } |
| 115 | |
| 116 | |
| 117 | . = ALIGN(8); |
| 118 | .bss : AT(ADDR(.bss) - LOAD_OFFSET) { |
| 119 | __bss_start = .; |
| 120 | *(.bss) |
| 121 | *(COMMON) |
| 122 | . = ALIGN(8); |
| 123 | __bss_stop = .; |
| 124 | _end = .; |
| 125 | } |
| 126 | |
| 127 | /* When something in the kernel is NOT compiled as a module, the module |
| 128 | * cleanup code and data are put into these segments. Both can then be |
| 129 | * thrown away, as cleanup code is never called unless it's a module. |
| 130 | */ |
| 131 | /DISCARD/ : { |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 132 | EXIT_DATA |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 133 | *(.exitcall.exit) |
| 134 | } |
| 135 | |
| 136 | DWARF_DEBUG |
| 137 | } |