Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame^] | 1 | /* ld script to make ARM Linux kernel |
| 2 | * taken from the i386 version by Russell King |
| 3 | * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz> |
| 4 | */ |
| 5 | |
| 6 | #include <asm-generic/vmlinux.lds.h> |
| 7 | #include <linux/config.h> |
| 8 | |
| 9 | OUTPUT_ARCH(arm) |
| 10 | ENTRY(stext) |
| 11 | #ifndef __ARMEB__ |
| 12 | jiffies = jiffies_64; |
| 13 | #else |
| 14 | jiffies = jiffies_64 + 4; |
| 15 | #endif |
| 16 | SECTIONS |
| 17 | { |
| 18 | . = TEXTADDR; |
| 19 | .init : { /* Init code and data */ |
| 20 | _stext = .; |
| 21 | _sinittext = .; |
| 22 | *(.init.text) |
| 23 | _einittext = .; |
| 24 | __proc_info_begin = .; |
| 25 | *(.proc.info) |
| 26 | __proc_info_end = .; |
| 27 | __arch_info_begin = .; |
| 28 | *(.arch.info) |
| 29 | __arch_info_end = .; |
| 30 | __tagtable_begin = .; |
| 31 | *(.taglist) |
| 32 | __tagtable_end = .; |
| 33 | . = ALIGN(16); |
| 34 | __setup_start = .; |
| 35 | *(.init.setup) |
| 36 | __setup_end = .; |
| 37 | __early_begin = .; |
| 38 | *(__early_param) |
| 39 | __early_end = .; |
| 40 | __initcall_start = .; |
| 41 | *(.initcall1.init) |
| 42 | *(.initcall2.init) |
| 43 | *(.initcall3.init) |
| 44 | *(.initcall4.init) |
| 45 | *(.initcall5.init) |
| 46 | *(.initcall6.init) |
| 47 | *(.initcall7.init) |
| 48 | __initcall_end = .; |
| 49 | __con_initcall_start = .; |
| 50 | *(.con_initcall.init) |
| 51 | __con_initcall_end = .; |
| 52 | __security_initcall_start = .; |
| 53 | *(.security_initcall.init) |
| 54 | __security_initcall_end = .; |
| 55 | . = ALIGN(32); |
| 56 | __initramfs_start = .; |
| 57 | usr/built-in.o(.init.ramfs) |
| 58 | __initramfs_end = .; |
| 59 | . = ALIGN(64); |
| 60 | __per_cpu_start = .; |
| 61 | *(.data.percpu) |
| 62 | __per_cpu_end = .; |
| 63 | #ifndef CONFIG_XIP_KERNEL |
| 64 | __init_begin = _stext; |
| 65 | *(.init.data) |
| 66 | . = ALIGN(4096); |
| 67 | __init_end = .; |
| 68 | #endif |
| 69 | } |
| 70 | |
| 71 | /DISCARD/ : { /* Exit code and data */ |
| 72 | *(.exit.text) |
| 73 | *(.exit.data) |
| 74 | *(.exitcall.exit) |
| 75 | } |
| 76 | |
| 77 | .text : { /* Real text segment */ |
| 78 | _text = .; /* Text and read-only data */ |
| 79 | *(.text) |
| 80 | SCHED_TEXT |
| 81 | LOCK_TEXT |
| 82 | *(.fixup) |
| 83 | *(.gnu.warning) |
| 84 | *(.rodata) |
| 85 | *(.rodata.*) |
| 86 | *(.glue_7) |
| 87 | *(.glue_7t) |
| 88 | *(.got) /* Global offset table */ |
| 89 | } |
| 90 | |
| 91 | . = ALIGN(16); |
| 92 | __ex_table : { /* Exception table */ |
| 93 | __start___ex_table = .; |
| 94 | *(__ex_table) |
| 95 | __stop___ex_table = .; |
| 96 | } |
| 97 | |
| 98 | RODATA |
| 99 | |
| 100 | _etext = .; /* End of text and rodata section */ |
| 101 | |
| 102 | #ifdef CONFIG_XIP_KERNEL |
| 103 | __data_loc = ALIGN(4); /* location in binary */ |
| 104 | . = DATAADDR; |
| 105 | #else |
| 106 | . = ALIGN(8192); |
| 107 | __data_loc = .; |
| 108 | #endif |
| 109 | |
| 110 | .data : AT(__data_loc) { |
| 111 | __data_start = .; /* address in memory */ |
| 112 | |
| 113 | /* |
| 114 | * first, the init task union, aligned |
| 115 | * to an 8192 byte boundary. |
| 116 | */ |
| 117 | *(.init.task) |
| 118 | |
| 119 | #ifdef CONFIG_XIP_KERNEL |
| 120 | . = ALIGN(4096); |
| 121 | __init_begin = .; |
| 122 | *(.init.data) |
| 123 | . = ALIGN(4096); |
| 124 | __init_end = .; |
| 125 | #endif |
| 126 | |
| 127 | . = ALIGN(4096); |
| 128 | __nosave_begin = .; |
| 129 | *(.data.nosave) |
| 130 | . = ALIGN(4096); |
| 131 | __nosave_end = .; |
| 132 | |
| 133 | /* |
| 134 | * then the cacheline aligned data |
| 135 | */ |
| 136 | . = ALIGN(32); |
| 137 | *(.data.cacheline_aligned) |
| 138 | |
| 139 | /* |
| 140 | * and the usual data section |
| 141 | */ |
| 142 | *(.data) |
| 143 | CONSTRUCTORS |
| 144 | |
| 145 | _edata = .; |
| 146 | } |
| 147 | |
| 148 | .bss : { |
| 149 | __bss_start = .; /* BSS */ |
| 150 | *(.bss) |
| 151 | *(COMMON) |
| 152 | _end = .; |
| 153 | } |
| 154 | /* Stabs debugging sections. */ |
| 155 | .stab 0 : { *(.stab) } |
| 156 | .stabstr 0 : { *(.stabstr) } |
| 157 | .stab.excl 0 : { *(.stab.excl) } |
| 158 | .stab.exclstr 0 : { *(.stab.exclstr) } |
| 159 | .stab.index 0 : { *(.stab.index) } |
| 160 | .stab.indexstr 0 : { *(.stab.indexstr) } |
| 161 | .comment 0 : { *(.comment) } |
| 162 | } |
| 163 | |
| 164 | /* those must never be empty */ |
| 165 | ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support") |
| 166 | ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined") |