blob: c98905f71e28ce78a1ab06e7b310653efa2156a9 [file] [log] [blame]
Paul Mundtdce97c82009-05-09 23:36:10 +09001/*
2 * ld script to make SuperH Linux kernel
3 * Written by Niibe Yutaka and Paul Mundt
4 */
5#ifdef CONFIG_SUPERH64
Paul Mundt19f6b8b2010-02-12 15:41:45 +09006#define LOAD_OFFSET PAGE_OFFSET
Paul Mundtdce97c82009-05-09 23:36:10 +09007OUTPUT_ARCH(sh:sh5)
Linus Torvalds1da177e2005-04-16 15:20:36 -07008#else
Paul Mundt7b022d02009-05-10 00:25:08 +09009#define LOAD_OFFSET 0
Paul Mundtdce97c82009-05-09 23:36:10 +090010OUTPUT_ARCH(sh)
Paul Mundtdce97c82009-05-09 23:36:10 +090011#endif
12
13#include <asm/thread_info.h>
14#include <asm/cache.h>
Matt Flemingbd353862009-08-14 01:58:43 +090015#include <asm/vmlinux.lds.h>
Paul Mundtdce97c82009-05-09 23:36:10 +090016
Paul Mundt1d5cfcd2010-02-16 21:43:38 +090017#ifdef CONFIG_PMB
18 #define MEMORY_OFFSET 0
Paul Mundt04c86972010-02-15 16:10:57 +090019#else
Paul Mundt1d5cfcd2010-02-16 21:43:38 +090020 #define MEMORY_OFFSET __MEMORY_START
Paul Mundt04c86972010-02-15 16:10:57 +090021#endif
22
Paul Mundtdce97c82009-05-09 23:36:10 +090023ENTRY(_start)
24SECTIONS
25{
Simon Hormane66ac3f2011-09-15 20:13:00 +090026 . = PAGE_OFFSET + MEMORY_OFFSET + PHYSICAL_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
Paul Mundtdce97c82009-05-09 23:36:10 +090027
Magnus Damm53c00542009-05-11 08:45:27 +000028 _text = .; /* Text and read-only data */
29
Paul Mundtdce97c82009-05-09 23:36:10 +090030 .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 Mundtdce97c82009-05-09 23:36:10 +090035 HEAD_TEXT
36 TEXT_TEXT
Paul Mundt19f6b8b2010-02-12 15:41:45 +090037 EXTRA_TEXT
Paul Mundtdce97c82009-05-09 23:36:10 +090038 SCHED_TEXT
39 LOCK_TEXT
40 KPROBES_TEXT
41 IRQENTRY_TEXT
42 *(.fixup)
43 *(.gnu.warning)
44 _etext = .; /* End of text section */
45 } = 0x0009
46
Tim Abbott2802e342009-07-09 14:45:59 +000047 EXCEPTION_TABLE(16)
Paul Mundtdce97c82009-05-09 23:36:10 +090048 NOTES
Chris Smith660e2ac2010-01-27 22:03:11 +090049
50 _sdata = .;
Paul Mundtdce97c82009-05-09 23:36:10 +090051 RO_DATA(PAGE_SIZE)
Tim Abbott2802e342009-07-09 14:45:59 +000052 RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
Chris Smith660e2ac2010-01-27 22:03:11 +090053 _edata = .;
Paul Mundtdce97c82009-05-09 23:36:10 +090054
Matt Flemingbd353862009-08-14 01:58:43 +090055 DWARF_EH_FRAME
56
Paul Mundtdce97c82009-05-09 23:36:10 +090057 . = ALIGN(PAGE_SIZE); /* Init code and data */
Tim Abbott2802e342009-07-09 14:45:59 +000058 __init_begin = .;
59 INIT_TEXT_SECTION(PAGE_SIZE)
60 INIT_DATA_SECTION(16)
Paul Mundtdce97c82009-05-09 23:36:10 +090061
62 . = ALIGN(4);
63 .machvec.init : AT(ADDR(.machvec.init) - LOAD_OFFSET) {
64 __machvec_start = .;
65 *(.machvec.init)
66 __machvec_end = .;
67 }
68
Tejun Heo0415b002011-03-24 18:50:09 +010069 PERCPU_SECTION(L1_CACHE_BYTES)
Paul Mundtdce97c82009-05-09 23:36:10 +090070
71 /*
72 * .exit.text is discarded at runtime, not link time, to deal with
73 * references from __bug_table
74 */
75 .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { EXIT_TEXT }
76 .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { EXIT_DATA }
77
78 . = ALIGN(PAGE_SIZE);
Tim Abbott2802e342009-07-09 14:45:59 +000079 __init_end = .;
Tim Abbott6bde6072009-07-20 23:30:24 +090080 BSS_SECTION(0, PAGE_SIZE, 4)
Tim Abbott2802e342009-07-09 14:45:59 +000081 _ebss = .; /* uClinux MTD sucks */
82 _end = . ;
Paul Mundtdce97c82009-05-09 23:36:10 +090083
Paul Mundtdce97c82009-05-09 23:36:10 +090084 STABS_DEBUG
85 DWARF_DEBUG
Tejun Heo023bf6f2009-07-09 11:27:40 +090086
Tejun Heo023bf6f2009-07-09 11:27:40 +090087 DISCARDS
Paul Mundtdce97c82009-05-09 23:36:10 +090088}