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