3236727be2b9a3f4df15a2f39bce5fb6ceb68067
[deliverable/linux.git] / arch / arm64 / kernel / vmlinux.lds.S
1 /*
2 * ld script to make ARM Linux kernel
3 * taken from the i386 version by Russell King
4 * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
5 */
6
7 #include <asm-generic/vmlinux.lds.h>
8 #include <asm/thread_info.h>
9 #include <asm/memory.h>
10 #include <asm/page.h>
11
12 #include "image.h"
13
14 #define ARM_EXIT_KEEP(x)
15 #define ARM_EXIT_DISCARD(x) x
16
17 OUTPUT_ARCH(aarch64)
18 ENTRY(_text)
19
20 jiffies = jiffies_64;
21
22 #define HYPERVISOR_TEXT \
23 /* \
24 * Force the alignment to be compatible with \
25 * the vectors requirements \
26 */ \
27 . = ALIGN(2048); \
28 VMLINUX_SYMBOL(__hyp_idmap_text_start) = .; \
29 *(.hyp.idmap.text) \
30 VMLINUX_SYMBOL(__hyp_idmap_text_end) = .; \
31 VMLINUX_SYMBOL(__hyp_text_start) = .; \
32 *(.hyp.text) \
33 VMLINUX_SYMBOL(__hyp_text_end) = .;
34
35 /*
36 * The size of the PE/COFF section that covers the kernel image, which
37 * runs from stext to _edata, must be a round multiple of the PE/COFF
38 * FileAlignment, which we set to its minimum value of 0x200. 'stext'
39 * itself is 4 KB aligned, so padding out _edata to a 0x200 aligned
40 * boundary should be sufficient.
41 */
42 PECOFF_FILE_ALIGNMENT = 0x200;
43
44 #ifdef CONFIG_EFI
45 #define PECOFF_EDATA_PADDING \
46 .pecoff_edata_padding : { BYTE(0); . = ALIGN(PECOFF_FILE_ALIGNMENT); }
47 #else
48 #define PECOFF_EDATA_PADDING
49 #endif
50
51 SECTIONS
52 {
53 /*
54 * XXX: The linker does not define how output sections are
55 * assigned to input sections when there are multiple statements
56 * matching the same input section name. There is no documented
57 * order of matching.
58 */
59 /DISCARD/ : {
60 ARM_EXIT_DISCARD(EXIT_TEXT)
61 ARM_EXIT_DISCARD(EXIT_DATA)
62 EXIT_CALL
63 *(.discard)
64 *(.discard.*)
65 }
66
67 . = PAGE_OFFSET + TEXT_OFFSET;
68
69 .head.text : {
70 _text = .;
71 HEAD_TEXT
72 }
73 .text : { /* Real text segment */
74 _stext = .; /* Text and read-only data */
75 __exception_text_start = .;
76 *(.exception.text)
77 __exception_text_end = .;
78 IRQENTRY_TEXT
79 TEXT_TEXT
80 SCHED_TEXT
81 LOCK_TEXT
82 HYPERVISOR_TEXT
83 *(.fixup)
84 *(.gnu.warning)
85 . = ALIGN(16);
86 *(.got) /* Global offset table */
87 }
88
89 RO_DATA(PAGE_SIZE)
90 EXCEPTION_TABLE(8)
91 NOTES
92 _etext = .; /* End of text and rodata section */
93
94 . = ALIGN(PAGE_SIZE);
95 __init_begin = .;
96
97 INIT_TEXT_SECTION(8)
98 .exit.text : {
99 ARM_EXIT_KEEP(EXIT_TEXT)
100 }
101 . = ALIGN(16);
102 .init.data : {
103 INIT_DATA
104 INIT_SETUP(16)
105 INIT_CALLS
106 CON_INITCALL
107 SECURITY_INITCALL
108 INIT_RAM_FS
109 }
110 .exit.data : {
111 ARM_EXIT_KEEP(EXIT_DATA)
112 }
113
114 PERCPU_SECTION(64)
115
116 . = ALIGN(PAGE_SIZE);
117 __init_end = .;
118
119 . = ALIGN(4);
120 .altinstructions : {
121 __alt_instructions = .;
122 *(.altinstructions)
123 __alt_instructions_end = .;
124 }
125 .altinstr_replacement : {
126 *(.altinstr_replacement)
127 }
128
129 . = ALIGN(PAGE_SIZE);
130 _data = .;
131 _sdata = .;
132 RW_DATA_SECTION(64, PAGE_SIZE, THREAD_SIZE)
133 PECOFF_EDATA_PADDING
134 _edata = .;
135
136 BSS_SECTION(0, 0, 0)
137
138 . = ALIGN(PAGE_SIZE);
139 idmap_pg_dir = .;
140 . += IDMAP_DIR_SIZE;
141 swapper_pg_dir = .;
142 . += SWAPPER_DIR_SIZE;
143
144 _end = .;
145
146 STABS_DEBUG
147
148 HEAD_SYMBOLS
149 }
150
151 /*
152 * The HYP init code can't be more than a page long.
153 */
154 ASSERT(((__hyp_idmap_text_start + PAGE_SIZE) > __hyp_idmap_text_end),
155 "HYP init code too big")
156
157 /*
158 * If padding is applied before .head.text, virt<->phys conversions will fail.
159 */
160 ASSERT(_text == (PAGE_OFFSET + TEXT_OFFSET), "HEAD is misaligned")
This page took 0.042767 seconds and 4 git commands to generate.