Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.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 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      */
59                         __exception_text_start = .;
60                         *(.exception.text)
61                         __exception_text_end = .;
62                         IRQENTRY_TEXT
63                         TEXT_TEXT
64                         SCHED_TEXT
65                         LOCK_TEXT
66                         HYPERVISOR_TEXT
67                         *(.fixup)
68                         *(.gnu.warning)
69                 . = ALIGN(16);
70                 *(.got)                 /* Global offset table          */
71         }
72
73         RO_DATA(PAGE_SIZE)
74         EXCEPTION_TABLE(8)
75         NOTES
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         . = ALIGN(PAGE_SIZE);
101         __init_end = .;
102
103         _data = .;
104         _sdata = .;
105         RW_DATA_SECTION(64, PAGE_SIZE, THREAD_SIZE)
106         _edata = .;
107
108         BSS_SECTION(0, 0, 0)
109
110         . = ALIGN(PAGE_SIZE);
111         idmap_pg_dir = .;
112         . += IDMAP_DIR_SIZE;
113         swapper_pg_dir = .;
114         . += SWAPPER_DIR_SIZE;
115
116         _end = .;
117
118         STABS_DEBUG
119
120         HEAD_SYMBOLS
121 }
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")
128
129 /*
130  * If padding is applied before .head.text, virt<->phys conversions will fail.
131  */
132 ASSERT(_text == (PAGE_OFFSET + TEXT_OFFSET), "HEAD is misaligned")