blob: 2d5f1c3f1afbc54c9d34afb8396fc8bea326a295 [file] [log] [blame]
David Howellsb920de12008-02-08 04:19:31 -08001/* MN10300 Main kernel linker script
2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11#define __VMLINUX_LDS__
12#include <asm-generic/vmlinux.lds.h>
13#include <asm/thread_info.h>
Cyrill Gorcunovcb328982008-12-10 12:43:19 +000014#include <asm/page.h>
David Howellsb920de12008-02-08 04:19:31 -080015
16OUTPUT_FORMAT("elf32-am33lin", "elf32-am33lin", "elf32-am33lin")
17OUTPUT_ARCH(mn10300)
18ENTRY(_start)
19jiffies = jiffies_64;
20#ifndef CONFIG_MN10300_CURRENT_IN_E2
21current = __current;
22#endif
23SECTIONS
24{
25 . = CONFIG_KERNEL_TEXT_ADDRESS;
26 /* read-only */
27 _stext = .;
28 _text = .; /* Text and read-only data */
29 .text : {
Tim Abbott9760f8f2009-04-25 22:11:04 -040030 HEAD_TEXT
David Howellsb920de12008-02-08 04:19:31 -080031 TEXT_TEXT
32 SCHED_TEXT
Chris Metcalf6727ad92016-10-07 17:02:55 -070033 CPUIDLE_TEXT
David Howellsb920de12008-02-08 04:19:31 -080034 LOCK_TEXT
35 KPROBES_TEXT
36 *(.fixup)
37 *(.gnu.warning)
38 } = 0xcb
39
40 _etext = .; /* End of text section */
41
David Howells2e8b5a02009-06-22 15:32:36 +010042 EXCEPTION_TABLE(16)
David Howellsb920de12008-02-08 04:19:31 -080043 BUG_TABLE
44
David Howells2e8b5a02009-06-22 15:32:36 +010045 RO_DATA(PAGE_SIZE)
David Howellsb920de12008-02-08 04:19:31 -080046
47 /* writeable */
David Howells40182372011-06-06 15:47:23 +010048 _sdata = .; /* Start of rw data section */
Tim Abbott4295f8b2009-09-24 10:36:22 -040049 RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE)
50 _edata = .;
David Howellsb920de12008-02-08 04:19:31 -080051
52 /* might get freed after init */
Cyrill Gorcunovcb328982008-12-10 12:43:19 +000053 . = ALIGN(PAGE_SIZE);
David Howellsb920de12008-02-08 04:19:31 -080054 .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
55 __smp_locks = .;
56 *(.smp_locks)
57 __smp_locks_end = .;
58 }
59
60 /* will be freed after init */
Cyrill Gorcunovcb328982008-12-10 12:43:19 +000061 . = ALIGN(PAGE_SIZE); /* Init code and data */
David Howellsb920de12008-02-08 04:19:31 -080062 __init_begin = .;
Tim Abbott4295f8b2009-09-24 10:36:22 -040063 INIT_TEXT_SECTION(PAGE_SIZE)
64 INIT_DATA_SECTION(16)
David Howellsb920de12008-02-08 04:19:31 -080065 . = ALIGN(4);
66 __alt_instructions = .;
67 .altinstructions : { *(.altinstructions) }
68 __alt_instructions_end = .;
69 .altinstr_replacement : { *(.altinstr_replacement) }
70 /* .exit.text is discard at runtime, not link time, to deal with references
71 from .altinstructions and .eh_frame */
David Howells2e8b5a02009-06-22 15:32:36 +010072 .exit.text : { EXIT_TEXT; }
73 .exit.data : { EXIT_DATA; }
David Howellsb920de12008-02-08 04:19:31 -080074
Tejun Heo0415b00d12011-03-24 18:50:09 +010075 PERCPU_SECTION(32)
Cyrill Gorcunovcb328982008-12-10 12:43:19 +000076 . = ALIGN(PAGE_SIZE);
David Howellsb920de12008-02-08 04:19:31 -080077 __init_end = .;
78 /* freed after init ends here */
79
Tim Abbott04e448d2009-07-12 18:23:33 -040080 BSS_SECTION(0, PAGE_SIZE, 4)
David Howellsb920de12008-02-08 04:19:31 -080081
82 _end = . ;
83
84 /* This is where the kernel creates the early boot page tables */
Cyrill Gorcunovcb328982008-12-10 12:43:19 +000085 . = ALIGN(PAGE_SIZE);
David Howellsb920de12008-02-08 04:19:31 -080086 pg0 = .;
87
David Howellsb920de12008-02-08 04:19:31 -080088 STABS_DEBUG
89
90 DWARF_DEBUG
Tejun Heo023bf6f2009-07-09 11:27:40 +090091
92 /* Sections to be discarded */
93 DISCARDS
David Howellsb920de12008-02-08 04:19:31 -080094}