9a44e92b65e22a87e9a4834385961ae8928f95e7
[cascardo/linux.git] / arch / parisc / kernel / vmlinux.lds.S
1 /*    Kernel link layout for various "sections"
2  *
3  *    Copyright (C) 1999-2003 Matthew Wilcox <willy at parisc-linux.org>
4  *    Copyright (C) 2000-2003 Paul Bame <bame at parisc-linux.org>
5  *    Copyright (C) 2000 John Marvin <jsm at parisc-linux.org>
6  *    Copyright (C) 2000 Michael Ang <mang with subcarrier.org>
7  *    Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>
8  *    Copyright (C) 2003 James Bottomley <jejb with parisc-linux.org>
9  *    Copyright (C) 2006-2013 Helge Deller <deller@gmx.de>
10  */
11
12 /*
13  * Put page table entries (swapper_pg_dir) as the first thing in .bss. This
14  * will ensure that it has .bss alignment (PAGE_SIZE).
15  */
16 #define BSS_FIRST_SECTIONS      *(.data..vm0.pmd) \
17                                 *(.data..vm0.pgd) \
18                                 *(.data..vm0.pte)
19
20 #include <asm-generic/vmlinux.lds.h>
21
22 /* needed for the processor specific cache alignment size */    
23 #include <asm/cache.h>
24 #include <asm/page.h>
25 #include <asm/asm-offsets.h>
26 #include <asm/thread_info.h>
27         
28 /* ld script to make hppa Linux kernel */
29 #ifndef CONFIG_64BIT
30 OUTPUT_FORMAT("elf32-hppa-linux")
31 OUTPUT_ARCH(hppa)
32 #else
33 OUTPUT_FORMAT("elf64-hppa-linux")
34 OUTPUT_ARCH(hppa:hppa2.0w)
35 #endif
36
37 ENTRY(parisc_kernel_start)
38 #ifndef CONFIG_64BIT
39 jiffies = jiffies_64 + 4;
40 #else
41 jiffies = jiffies_64;
42 #endif
43 SECTIONS
44 {
45         . = KERNEL_BINARY_TEXT_START;
46
47         __init_begin = .;
48         HEAD_TEXT_SECTION
49         INIT_TEXT_SECTION(8)
50
51         . = ALIGN(PAGE_SIZE);
52         INIT_DATA_SECTION(PAGE_SIZE)
53         /* we have to discard exit text and such at runtime, not link time */
54         .exit.text :
55         {
56                 EXIT_TEXT
57         }
58         .exit.data :
59         {
60                 EXIT_DATA
61         }
62         PERCPU_SECTION(8)
63         . = ALIGN(HUGEPAGE_SIZE);
64         __init_end = .;
65         /* freed after init ends here */
66
67         _text = .;              /* Text and read-only data */
68         _stext = .;
69         .text ALIGN(PAGE_SIZE) : {
70                 TEXT_TEXT
71                 SCHED_TEXT
72                 CPUIDLE_TEXT
73                 LOCK_TEXT
74                 KPROBES_TEXT
75                 IRQENTRY_TEXT
76                 SOFTIRQENTRY_TEXT
77                 *(.text.do_softirq)
78                 *(.text.sys_exit)
79                 *(.text.do_sigaltstack)
80                 *(.text.do_fork)
81                 *(.text.*)
82                 *(.fixup)
83                 *(.lock.text)           /* out-of-line lock text */
84                 *(.gnu.warning)
85         }
86         . = ALIGN(PAGE_SIZE);
87         _etext = .;
88         /* End of text section */
89
90         /* Start of data section */
91         _sdata = .;
92
93         /* Architecturally we need to keep __gp below 0x1000000 and thus
94          * in front of RO_DATA_SECTION() which stores lots of tracepoint
95          * and ftrace symbols. */
96 #ifdef CONFIG_64BIT
97         . = ALIGN(16);
98         /* Linkage tables */
99         .opd : {
100                 *(.opd)
101         } PROVIDE (__gp = .);
102         .plt : {
103                 *(.plt)
104         }
105         .dlt : {
106                 *(.dlt)
107         }
108 #endif
109
110         RO_DATA_SECTION(8)
111
112         /* unwind info */
113         .PARISC.unwind : {
114                 __start___unwind = .;
115                 *(.PARISC.unwind)
116                 __stop___unwind = .;
117         }
118
119         /* writeable */
120         /* Make sure this is page aligned so
121          * that we can properly leave these
122          * as writable
123          */
124         . = ALIGN(HUGEPAGE_SIZE);
125         data_start = .;
126
127         EXCEPTION_TABLE(8)
128         NOTES
129
130         /* Data */
131         RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, PAGE_SIZE)
132
133         /* PA-RISC locks requires 16-byte alignment */
134         . = ALIGN(16);
135         .data..lock_aligned : {
136                 *(.data..lock_aligned)
137         }
138
139         /* End of data section */
140         _edata = .;
141
142         /* BSS */
143         BSS_SECTION(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE)
144
145         . = ALIGN(HUGEPAGE_SIZE);
146         _end = . ;
147
148         STABS_DEBUG
149         .note 0 : { *(.note) }
150
151         /* Sections to be discarded */
152         DISCARDS
153         /DISCARD/ : {
154 #ifdef CONFIG_64BIT
155                 /* temporary hack until binutils is fixed to not emit these
156                  * for static binaries
157                  */
158                 *(.interp)
159                 *(.dynsym)
160                 *(.dynstr)
161                 *(.dynamic)
162                 *(.hash)
163                 *(.gnu.hash)
164 #endif
165         }
166 }