]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
dce97c8c PM |
2 | /* |
3 | * ld script to make SuperH Linux kernel | |
4 | * Written by Niibe Yutaka and Paul Mundt | |
5 | */ | |
6 | #ifdef CONFIG_SUPERH64 | |
19f6b8b4 | 7 | #define LOAD_OFFSET PAGE_OFFSET |
dce97c8c | 8 | OUTPUT_ARCH(sh:sh5) |
1da177e4 | 9 | #else |
7b022d07 | 10 | #define LOAD_OFFSET 0 |
dce97c8c | 11 | OUTPUT_ARCH(sh) |
dce97c8c PM |
12 | #endif |
13 | ||
14 | #include <asm/thread_info.h> | |
15 | #include <asm/cache.h> | |
bd353861 | 16 | #include <asm/vmlinux.lds.h> |
dce97c8c | 17 | |
1d5cfcdf PM |
18 | #ifdef CONFIG_PMB |
19 | #define MEMORY_OFFSET 0 | |
04c86973 | 20 | #else |
1d5cfcdf | 21 | #define MEMORY_OFFSET __MEMORY_START |
04c86973 PM |
22 | #endif |
23 | ||
dce97c8c PM |
24 | ENTRY(_start) |
25 | SECTIONS | |
26 | { | |
e66ac3f2 | 27 | . = PAGE_OFFSET + MEMORY_OFFSET + PHYSICAL_OFFSET + CONFIG_ZERO_PAGE_OFFSET; |
dce97c8c | 28 | |
53c0054c MD |
29 | _text = .; /* Text and read-only data */ |
30 | ||
dce97c8c PM |
31 | .empty_zero_page : AT(ADDR(.empty_zero_page) - LOAD_OFFSET) { |
32 | *(.empty_zero_page) | |
33 | } = 0 | |
34 | ||
35 | .text : AT(ADDR(.text) - LOAD_OFFSET) { | |
dce97c8c PM |
36 | HEAD_TEXT |
37 | TEXT_TEXT | |
19f6b8b4 | 38 | EXTRA_TEXT |
dce97c8c | 39 | SCHED_TEXT |
6727ad9e | 40 | CPUIDLE_TEXT |
dce97c8c PM |
41 | LOCK_TEXT |
42 | KPROBES_TEXT | |
43 | IRQENTRY_TEXT | |
be7635e7 | 44 | SOFTIRQENTRY_TEXT |
dce97c8c PM |
45 | *(.fixup) |
46 | *(.gnu.warning) | |
47 | _etext = .; /* End of text section */ | |
48 | } = 0x0009 | |
49 | ||
2802e345 | 50 | EXCEPTION_TABLE(16) |
dce97c8c | 51 | NOTES |
660e2aca CS |
52 | |
53 | _sdata = .; | |
dce97c8c | 54 | RO_DATA(PAGE_SIZE) |
2802e345 | 55 | RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) |
660e2aca | 56 | _edata = .; |
dce97c8c | 57 | |
bd353861 MF |
58 | DWARF_EH_FRAME |
59 | ||
dce97c8c | 60 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
2802e345 TA |
61 | __init_begin = .; |
62 | INIT_TEXT_SECTION(PAGE_SIZE) | |
63 | INIT_DATA_SECTION(16) | |
dce97c8c PM |
64 | |
65 | . = ALIGN(4); | |
66 | .machvec.init : AT(ADDR(.machvec.init) - LOAD_OFFSET) { | |
67 | __machvec_start = .; | |
68 | *(.machvec.init) | |
69 | __machvec_end = .; | |
70 | } | |
71 | ||
0415b00d | 72 | PERCPU_SECTION(L1_CACHE_BYTES) |
dce97c8c PM |
73 | |
74 | /* | |
75 | * .exit.text is discarded at runtime, not link time, to deal with | |
76 | * references from __bug_table | |
77 | */ | |
78 | .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { EXIT_TEXT } | |
79 | .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { EXIT_DATA } | |
80 | ||
81 | . = ALIGN(PAGE_SIZE); | |
2802e345 | 82 | __init_end = .; |
6bde607e | 83 | BSS_SECTION(0, PAGE_SIZE, 4) |
2802e345 | 84 | _end = . ; |
dce97c8c | 85 | |
dce97c8c PM |
86 | STABS_DEBUG |
87 | DWARF_DEBUG | |
023bf6f1 | 88 | |
023bf6f1 | 89 | DISCARDS |
dce97c8c | 90 | } |