summaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel/vmlinux.lds.S
blob: a13ed902afbbd645c521a7751f5930d76b5c8704 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#include <asm-generic/vmlinux.lds.h>
#include <asm/page.h>
#include <asm/cache.h>
#include <asm/thread_info.h>
#include <hv/hypervisor.h>

/* Text loads starting from the supervisor interrupt vector address. */
#define TEXT_OFFSET MEM_SV_INTRPT

OUTPUT_ARCH(tile)
ENTRY(_start)
jiffies = jiffies_64;

PHDRS
{
  intrpt1 PT_LOAD ;
  text PT_LOAD ;
  data PT_LOAD ;
}
SECTIONS
{
  /* Text is loaded with a different VA than data; start with text. */
  #undef LOAD_OFFSET
  #define LOAD_OFFSET TEXT_OFFSET

  /* Interrupt vectors */
  .intrpt1 (LOAD_OFFSET) : AT ( 0 )   /* put at the start of physical memory */
  {
    _text = .;
    *(.intrpt1)
  } :intrpt1 =0

  /* Hypervisor call vectors */
  #include "hvglue.lds"

  /* Now the real code */
  . = ALIGN(0x20000);
  _stext = .;
  .text : AT (ADDR(.text) - LOAD_OFFSET) {
    HEAD_TEXT
    SCHED_TEXT
    LOCK_TEXT
    __fix_text_end = .;   /* tile-cpack won't rearrange before this */
    TEXT_TEXT
    *(.text.*)
    *(.coldtext*)
    *(.fixup)
    *(.gnu.warning)
  } :text =0
  _etext = .;

  /* "Init" is divided into two areas with very different virtual addresses. */
  INIT_TEXT_SECTION(PAGE_SIZE)

  /* Now we skip back to PAGE_OFFSET for the data. */
  . = (. - TEXT_OFFSET + PAGE_OFFSET);
  #undef LOAD_OFFSET
  #define LOAD_OFFSET PAGE_OFFSET

  . = ALIGN(PAGE_SIZE);
  __init_begin = .;
  VMLINUX_SYMBOL(_sinitdata) = .;
  INIT_DATA_SECTION(16) :data =0
  PERCPU_SECTION(L2_CACHE_BYTES)
  . = ALIGN(PAGE_SIZE);
  VMLINUX_SYMBOL(_einitdata) = .;
  __init_end = .;

  _sdata = .;                   /* Start of data section */

  RO_DATA_SECTION(PAGE_SIZE)

  /* initially writeable, then read-only */
  . = ALIGN(PAGE_SIZE);
  __w1data_begin = .;
  .w1data : AT(ADDR(.w1data) - LOAD_OFFSET) {
    VMLINUX_SYMBOL(__w1data_begin) = .;
    *(.w1data)
    VMLINUX_SYMBOL(__w1data_end) = .;
  }

  RW_DATA_SECTION(L2_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)

  _edata = .;

  EXCEPTION_TABLE(L2_CACHE_BYTES)
  NOTES


  BSS_SECTION(8, PAGE_SIZE, 1)
  _end = . ;

  STABS_DEBUG
  DWARF_DEBUG

  DISCARDS
}