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