Commit | Line | Data |
---|---|---|
8c2c3df3 CM |
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 | ||
a2c1d73b MR |
12 | #include "image.h" |
13 | ||
8c2c3df3 CM |
14 | #define ARM_EXIT_KEEP(x) |
15 | #define ARM_EXIT_DISCARD(x) x | |
16 | ||
17 | OUTPUT_ARCH(aarch64) | |
af885f40 | 18 | ENTRY(_text) |
8c2c3df3 CM |
19 | |
20 | jiffies = jiffies_64; | |
21 | ||
2240bbb6 MZ |
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 | ||
8c2c3df3 CM |
35 | SECTIONS |
36 | { | |
37 | /* | |
38 | * XXX: The linker does not define how output sections are | |
39 | * assigned to input sections when there are multiple statements | |
40 | * matching the same input section name. There is no documented | |
41 | * order of matching. | |
42 | */ | |
43 | /DISCARD/ : { | |
44 | ARM_EXIT_DISCARD(EXIT_TEXT) | |
45 | ARM_EXIT_DISCARD(EXIT_DATA) | |
46 | EXIT_CALL | |
47 | *(.discard) | |
48 | *(.discard.*) | |
49 | } | |
50 | ||
51 | . = PAGE_OFFSET + TEXT_OFFSET; | |
52 | ||
53 | .head.text : { | |
54 | _text = .; | |
55 | HEAD_TEXT | |
56 | } | |
57 | .text : { /* Real text segment */ | |
58 | _stext = .; /* Text and read-only data */ | |
8c2c3df3 CM |
59 | __exception_text_start = .; |
60 | *(.exception.text) | |
61 | __exception_text_end = .; | |
62 | IRQENTRY_TEXT | |
63 | TEXT_TEXT | |
64 | SCHED_TEXT | |
65 | LOCK_TEXT | |
2240bbb6 | 66 | HYPERVISOR_TEXT |
8c2c3df3 CM |
67 | *(.fixup) |
68 | *(.gnu.warning) | |
69 | . = ALIGN(16); | |
70 | *(.got) /* Global offset table */ | |
71 | } | |
72 | ||
73 | RO_DATA(PAGE_SIZE) | |
adace895 | 74 | EXCEPTION_TABLE(8) |
c80b7ee8 | 75 | NOTES |
8c2c3df3 CM |
76 | _etext = .; /* End of text and rodata section */ |
77 | ||
78 | . = ALIGN(PAGE_SIZE); | |
79 | __init_begin = .; | |
80 | ||
81 | INIT_TEXT_SECTION(8) | |
82 | .exit.text : { | |
83 | ARM_EXIT_KEEP(EXIT_TEXT) | |
84 | } | |
85 | . = ALIGN(16); | |
86 | .init.data : { | |
87 | INIT_DATA | |
88 | INIT_SETUP(16) | |
89 | INIT_CALLS | |
90 | CON_INITCALL | |
91 | SECURITY_INITCALL | |
92 | INIT_RAM_FS | |
93 | } | |
94 | .exit.data : { | |
95 | ARM_EXIT_KEEP(EXIT_DATA) | |
96 | } | |
97 | ||
98 | PERCPU_SECTION(64) | |
99 | ||
100 | __init_end = .; | |
3c620626 MS |
101 | |
102 | . = ALIGN(PAGE_SIZE); | |
103 | _data = .; | |
3c620626 MS |
104 | _sdata = .; |
105 | RW_DATA_SECTION(64, PAGE_SIZE, THREAD_SIZE) | |
106 | _edata = .; | |
8c2c3df3 | 107 | |
8c2c3df3 | 108 | BSS_SECTION(0, 0, 0) |
bd00cd5f MR |
109 | |
110 | . = ALIGN(PAGE_SIZE); | |
111 | idmap_pg_dir = .; | |
112 | . += IDMAP_DIR_SIZE; | |
113 | swapper_pg_dir = .; | |
114 | . += SWAPPER_DIR_SIZE; | |
115 | ||
8c2c3df3 CM |
116 | _end = .; |
117 | ||
118 | STABS_DEBUG | |
a2c1d73b MR |
119 | |
120 | HEAD_SYMBOLS | |
8c2c3df3 | 121 | } |
2240bbb6 MZ |
122 | |
123 | /* | |
124 | * The HYP init code can't be more than a page long. | |
125 | */ | |
126 | ASSERT(((__hyp_idmap_text_start + PAGE_SIZE) > __hyp_idmap_text_end), | |
127 | "HYP init code too big") |