Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 1 | /* |
2 | * ld script to make SuperH Linux kernel | ||||
3 | * Written by Niibe Yutaka and Paul Mundt | ||||
4 | */ | ||||
5 | #ifdef CONFIG_SUPERH64 | ||||
Paul Mundt | 19f6b8b | 2010-02-12 15:41:45 +0900 | [diff] [blame] | 6 | #define LOAD_OFFSET PAGE_OFFSET |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 7 | OUTPUT_ARCH(sh:sh5) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | #else |
Paul Mundt | 7b022d0 | 2009-05-10 00:25:08 +0900 | [diff] [blame] | 9 | #define LOAD_OFFSET 0 |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 10 | OUTPUT_ARCH(sh) |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 11 | #endif |
12 | |||||
13 | #include <asm/thread_info.h> | ||||
14 | #include <asm/cache.h> | ||||
Matt Fleming | bd35386 | 2009-08-14 01:58:43 +0900 | [diff] [blame] | 15 | #include <asm/vmlinux.lds.h> |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 16 | |
Paul Mundt | 1d5cfcd | 2010-02-16 21:43:38 +0900 | [diff] [blame] | 17 | #ifdef CONFIG_PMB |
18 | #define MEMORY_OFFSET 0 | ||||
Paul Mundt | 04c8697 | 2010-02-15 16:10:57 +0900 | [diff] [blame] | 19 | #else |
Paul Mundt | 1d5cfcd | 2010-02-16 21:43:38 +0900 | [diff] [blame] | 20 | #define MEMORY_OFFSET __MEMORY_START |
Paul Mundt | 04c8697 | 2010-02-15 16:10:57 +0900 | [diff] [blame] | 21 | #endif |
22 | |||||
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 23 | ENTRY(_start) |
24 | SECTIONS | ||||
25 | { | ||||
Simon Horman | e66ac3f | 2011-09-15 20:13:00 +0900 | [diff] [blame] | 26 | . = PAGE_OFFSET + MEMORY_OFFSET + PHYSICAL_OFFSET + CONFIG_ZERO_PAGE_OFFSET; |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 27 | |
Magnus Damm | 53c0054 | 2009-05-11 08:45:27 +0000 | [diff] [blame] | 28 | _text = .; /* Text and read-only data */ |
29 | |||||
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 30 | .empty_zero_page : AT(ADDR(.empty_zero_page) - LOAD_OFFSET) { |
31 | *(.empty_zero_page) | ||||
32 | } = 0 | ||||
33 | |||||
34 | .text : AT(ADDR(.text) - LOAD_OFFSET) { | ||||
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 35 | HEAD_TEXT |
36 | TEXT_TEXT | ||||
Paul Mundt | 19f6b8b | 2010-02-12 15:41:45 +0900 | [diff] [blame] | 37 | EXTRA_TEXT |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 38 | SCHED_TEXT |
39 | LOCK_TEXT | ||||
40 | KPROBES_TEXT | ||||
41 | IRQENTRY_TEXT | ||||
Alexander Potapenko | be7635e | 2016-03-25 14:22:05 -0700 | [diff] [blame] | 42 | SOFTIRQENTRY_TEXT |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 43 | *(.fixup) |
44 | *(.gnu.warning) | ||||
45 | _etext = .; /* End of text section */ | ||||
46 | } = 0x0009 | ||||
47 | |||||
Tim Abbott | 2802e34 | 2009-07-09 14:45:59 +0000 | [diff] [blame] | 48 | EXCEPTION_TABLE(16) |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 49 | NOTES |
Chris Smith | 660e2ac | 2010-01-27 22:03:11 +0900 | [diff] [blame] | 50 | |
51 | _sdata = .; | ||||
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 52 | RO_DATA(PAGE_SIZE) |
Tim Abbott | 2802e34 | 2009-07-09 14:45:59 +0000 | [diff] [blame] | 53 | RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) |
Chris Smith | 660e2ac | 2010-01-27 22:03:11 +0900 | [diff] [blame] | 54 | _edata = .; |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 55 | |
Matt Fleming | bd35386 | 2009-08-14 01:58:43 +0900 | [diff] [blame] | 56 | DWARF_EH_FRAME |
57 | |||||
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 58 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
Tim Abbott | 2802e34 | 2009-07-09 14:45:59 +0000 | [diff] [blame] | 59 | __init_begin = .; |
60 | INIT_TEXT_SECTION(PAGE_SIZE) | ||||
61 | INIT_DATA_SECTION(16) | ||||
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 62 | |
63 | . = ALIGN(4); | ||||
64 | .machvec.init : AT(ADDR(.machvec.init) - LOAD_OFFSET) { | ||||
65 | __machvec_start = .; | ||||
66 | *(.machvec.init) | ||||
67 | __machvec_end = .; | ||||
68 | } | ||||
69 | |||||
Tejun Heo | 0415b00d1 | 2011-03-24 18:50:09 +0100 | [diff] [blame] | 70 | PERCPU_SECTION(L1_CACHE_BYTES) |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 71 | |
72 | /* | ||||
73 | * .exit.text is discarded at runtime, not link time, to deal with | ||||
74 | * references from __bug_table | ||||
75 | */ | ||||
76 | .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { EXIT_TEXT } | ||||
77 | .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { EXIT_DATA } | ||||
78 | |||||
79 | . = ALIGN(PAGE_SIZE); | ||||
Tim Abbott | 2802e34 | 2009-07-09 14:45:59 +0000 | [diff] [blame] | 80 | __init_end = .; |
Tim Abbott | 6bde607 | 2009-07-20 23:30:24 +0900 | [diff] [blame] | 81 | BSS_SECTION(0, PAGE_SIZE, 4) |
Tim Abbott | 2802e34 | 2009-07-09 14:45:59 +0000 | [diff] [blame] | 82 | _end = . ; |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 83 | |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 84 | STABS_DEBUG |
85 | DWARF_DEBUG | ||||
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 86 | |
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 87 | DISCARDS |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 88 | } |