blob: c60b19958c350b7c38420b33ea1029abb664c70d [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Paul Mundtdce97c82009-05-09 23:36:10 +09002/*
3 * ld script to make SuperH Linux kernel
4 * Written by Niibe Yutaka and Paul Mundt
5 */
6#ifdef CONFIG_SUPERH64
Paul Mundt19f6b8b2010-02-12 15:41:45 +09007#define LOAD_OFFSET PAGE_OFFSET
Paul Mundtdce97c82009-05-09 23:36:10 +09008OUTPUT_ARCH(sh:sh5)
Linus Torvalds1da177e2005-04-16 15:20:36 -07009#else
Paul Mundt7b022d02009-05-10 00:25:08 +090010#define LOAD_OFFSET 0
Paul Mundtdce97c82009-05-09 23:36:10 +090011OUTPUT_ARCH(sh)
Paul Mundtdce97c82009-05-09 23:36:10 +090012#endif
13
14#include <asm/thread_info.h>
15#include <asm/cache.h>
Matt Flemingbd353862009-08-14 01:58:43 +090016#include <asm/vmlinux.lds.h>
Paul Mundtdce97c82009-05-09 23:36:10 +090017
Paul Mundt1d5cfcd2010-02-16 21:43:38 +090018#ifdef CONFIG_PMB
19 #define MEMORY_OFFSET 0
Paul Mundt04c86972010-02-15 16:10:57 +090020#else
Paul Mundt1d5cfcd2010-02-16 21:43:38 +090021 #define MEMORY_OFFSET __MEMORY_START
Paul Mundt04c86972010-02-15 16:10:57 +090022#endif
23
Paul Mundtdce97c82009-05-09 23:36:10 +090024ENTRY(_start)
25SECTIONS
26{
Simon Hormane66ac3f2011-09-15 20:13:00 +090027 . = PAGE_OFFSET + MEMORY_OFFSET + PHYSICAL_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
Paul Mundtdce97c82009-05-09 23:36:10 +090028
Magnus Damm53c00542009-05-11 08:45:27 +000029 _text = .; /* Text and read-only data */
30
Paul Mundtdce97c82009-05-09 23:36:10 +090031 .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 Mundtdce97c82009-05-09 23:36:10 +090036 HEAD_TEXT
37 TEXT_TEXT
Paul Mundt19f6b8b2010-02-12 15:41:45 +090038 EXTRA_TEXT
Paul Mundtdce97c82009-05-09 23:36:10 +090039 SCHED_TEXT
Chris Metcalf6727ad92016-10-07 17:02:55 -070040 CPUIDLE_TEXT
Paul Mundtdce97c82009-05-09 23:36:10 +090041 LOCK_TEXT
42 KPROBES_TEXT
43 IRQENTRY_TEXT
Alexander Potapenkobe7635e2016-03-25 14:22:05 -070044 SOFTIRQENTRY_TEXT
Paul Mundtdce97c82009-05-09 23:36:10 +090045 *(.fixup)
46 *(.gnu.warning)
47 _etext = .; /* End of text section */
48 } = 0x0009
49
Tim Abbott2802e342009-07-09 14:45:59 +000050 EXCEPTION_TABLE(16)
Chris Smith660e2ac2010-01-27 22:03:11 +090051
52 _sdata = .;
Paul Mundtdce97c82009-05-09 23:36:10 +090053 RO_DATA(PAGE_SIZE)
Kees Cookc9174042019-10-29 14:13:35 -070054 RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
Chris Smith660e2ac2010-01-27 22:03:11 +090055 _edata = .;
Paul Mundtdce97c82009-05-09 23:36:10 +090056
Matt Flemingbd353862009-08-14 01:58:43 +090057 DWARF_EH_FRAME
58
Paul Mundtdce97c82009-05-09 23:36:10 +090059 . = ALIGN(PAGE_SIZE); /* Init code and data */
Tim Abbott2802e342009-07-09 14:45:59 +000060 __init_begin = .;
61 INIT_TEXT_SECTION(PAGE_SIZE)
62 INIT_DATA_SECTION(16)
Paul Mundtdce97c82009-05-09 23:36:10 +090063
64 . = ALIGN(4);
65 .machvec.init : AT(ADDR(.machvec.init) - LOAD_OFFSET) {
66 __machvec_start = .;
67 *(.machvec.init)
68 __machvec_end = .;
69 }
70
Tejun Heo0415b00d12011-03-24 18:50:09 +010071 PERCPU_SECTION(L1_CACHE_BYTES)
Paul Mundtdce97c82009-05-09 23:36:10 +090072
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 Abbott2802e342009-07-09 14:45:59 +000081 __init_end = .;
Tim Abbott6bde6072009-07-20 23:30:24 +090082 BSS_SECTION(0, PAGE_SIZE, 4)
Tim Abbott2802e342009-07-09 14:45:59 +000083 _end = . ;
Paul Mundtdce97c82009-05-09 23:36:10 +090084
Paul Mundtdce97c82009-05-09 23:36:10 +090085 STABS_DEBUG
86 DWARF_DEBUG
Tejun Heo023bf6f2009-07-09 11:27:40 +090087
Tejun Heo023bf6f2009-07-09 11:27:40 +090088 DISCARDS
Paul Mundtdce97c82009-05-09 23:36:10 +090089}