GNU Linux-libre 4.14.251-gnu1
[releases.git] / arch / tile / kernel / vmlinux.lds.S
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #include <asm-generic/vmlinux.lds.h>
3 #include <asm/page.h>
4 #include <asm/cache.h>
5 #include <asm/thread_info.h>
6 #include <hv/hypervisor.h>
7
8 /* Text loads starting from the supervisor interrupt vector address. */
9 #define TEXT_OFFSET MEM_SV_START
10
11 OUTPUT_ARCH(tile)
12 ENTRY(_start)
13 jiffies = jiffies_64;
14
15 PHDRS
16 {
17   intrpt PT_LOAD ;
18   text PT_LOAD ;
19   data PT_LOAD ;
20 }
21 SECTIONS
22 {
23   /* Text is loaded with a different VA than data; start with text. */
24   #undef LOAD_OFFSET
25   #define LOAD_OFFSET TEXT_OFFSET
26
27   /* Interrupt vectors */
28   .intrpt (LOAD_OFFSET) : AT ( 0 )   /* put at the start of physical memory */
29   {
30     _text = .;
31     *(.intrpt)
32   } :intrpt =0
33
34   /* Hypervisor call vectors */
35   . = ALIGN(0x10000);
36   .hvglue : AT (ADDR(.hvglue) - LOAD_OFFSET) {
37     *(.hvglue)
38   } :NONE
39
40   /* Now the real code */
41   . = ALIGN(0x20000);
42   _stext = .;
43   .text : AT (ADDR(.text) - LOAD_OFFSET) {
44     HEAD_TEXT
45     SCHED_TEXT
46     CPUIDLE_TEXT
47     LOCK_TEXT
48     KPROBES_TEXT
49     IRQENTRY_TEXT
50     SOFTIRQENTRY_TEXT
51     __fix_text_end = .;   /* tile-cpack won't rearrange before this */
52     ALIGN_FUNCTION();
53     *(.hottext*)
54     TEXT_TEXT
55     *(.text.*)
56     *(.coldtext*)
57     *(.fixup)
58     *(.gnu.warning)
59   } :text =0
60   _etext = .;
61
62   /* "Init" is divided into two areas with very different virtual addresses. */
63   INIT_TEXT_SECTION(PAGE_SIZE)
64
65   /*
66    * Some things, like the __jump_table, may contain symbol references
67    * to __exit text, so include such text in the final image if so.
68    * In that case we also override the _einittext from INIT_TEXT_SECTION.
69    */
70 #ifdef CONFIG_JUMP_LABEL
71   .exit.text : {
72     EXIT_TEXT
73     _einittext = .;
74   }
75 #endif
76
77   /* Now we skip back to PAGE_OFFSET for the data. */
78   . = (. - TEXT_OFFSET + PAGE_OFFSET);
79   #undef LOAD_OFFSET
80   #define LOAD_OFFSET PAGE_OFFSET
81
82   . = ALIGN(PAGE_SIZE);
83   __init_begin = .;
84   INIT_DATA_SECTION(16) :data =0
85   PERCPU_SECTION(L2_CACHE_BYTES)
86   . = ALIGN(PAGE_SIZE);
87   __init_end = .;
88
89   _sdata = .;                   /* Start of data section */
90   RO_DATA_SECTION(PAGE_SIZE)
91   RW_DATA_SECTION(L2_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
92   _edata = .;
93
94   EXCEPTION_TABLE(L2_CACHE_BYTES)
95   NOTES
96
97
98   BSS_SECTION(8, PAGE_SIZE, 1)
99   _end = . ;
100
101   STABS_DEBUG
102   DWARF_DEBUG
103
104   DISCARDS
105 }