Merge tag 'v3.10.30' into linux-linaro-lsk
[firefly-linux-kernel-4.4.55.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 #define ARM_EXIT_KEEP(x)
13 #define ARM_EXIT_DISCARD(x)     x
14
15 OUTPUT_ARCH(aarch64)
16 ENTRY(stext)
17
18 jiffies = jiffies_64;
19
20 SECTIONS
21 {
22         /*
23          * XXX: The linker does not define how output sections are
24          * assigned to input sections when there are multiple statements
25          * matching the same input section name.  There is no documented
26          * order of matching.
27          */
28         /DISCARD/ : {
29                 ARM_EXIT_DISCARD(EXIT_TEXT)
30                 ARM_EXIT_DISCARD(EXIT_DATA)
31                 EXIT_CALL
32                 *(.discard)
33                 *(.discard.*)
34         }
35
36         . = PAGE_OFFSET + TEXT_OFFSET;
37
38         .head.text : {
39                 _text = .;
40                 HEAD_TEXT
41         }
42         .text : {                       /* Real text segment            */
43                 _stext = .;             /* Text and read-only data      */
44                         __exception_text_start = .;
45                         *(.exception.text)
46                         __exception_text_end = .;
47                         IRQENTRY_TEXT
48                         TEXT_TEXT
49                         SCHED_TEXT
50                         LOCK_TEXT
51                         *(.fixup)
52                         *(.gnu.warning)
53                 . = ALIGN(16);
54                 *(.got)                 /* Global offset table          */
55         }
56
57         RO_DATA(PAGE_SIZE)
58
59         _etext = .;                     /* End of text and rodata section */
60
61         . = ALIGN(PAGE_SIZE);
62         __init_begin = .;
63
64         INIT_TEXT_SECTION(8)
65         .exit.text : {
66                 ARM_EXIT_KEEP(EXIT_TEXT)
67         }
68         . = ALIGN(16);
69         .init.data : {
70                 INIT_DATA
71                 INIT_SETUP(16)
72                 INIT_CALLS
73                 CON_INITCALL
74                 SECURITY_INITCALL
75                 INIT_RAM_FS
76         }
77         .exit.data : {
78                 ARM_EXIT_KEEP(EXIT_DATA)
79         }
80
81         PERCPU_SECTION(64)
82
83         __init_end = .;
84         . = ALIGN(THREAD_SIZE);
85         __data_loc = .;
86
87         .data : AT(__data_loc) {
88                 _data = .;              /* address in memory */
89                 _sdata = .;
90
91                 /*
92                  * first, the init task union, aligned
93                  * to an 8192 byte boundary.
94                  */
95                 INIT_TASK_DATA(THREAD_SIZE)
96                 NOSAVE_DATA
97                 CACHELINE_ALIGNED_DATA(64)
98                 READ_MOSTLY_DATA(64)
99
100                 /*
101                  * The exception fixup table (might need resorting at runtime)
102                  */
103                 . = ALIGN(32);
104                 __start___ex_table = .;
105                 *(__ex_table)
106                 __stop___ex_table = .;
107
108                 /*
109                  * and the usual data section
110                  */
111                 DATA_DATA
112                 CONSTRUCTORS
113
114                 _edata = .;
115         }
116         _edata_loc = __data_loc + SIZEOF(.data);
117
118         NOTES
119
120         BSS_SECTION(0, 0, 0)
121         _end = .;
122
123         STABS_DEBUG
124         .comment 0 : { *(.comment) }
125 }