xref: /openbmc/linux/arch/hexagon/kernel/vmlinux.lds.S (revision 0b04ea6822936757cf7b18713e3d6ad05e97c883)
1e95bf452SRichard Kuo/*
2e95bf452SRichard Kuo * Linker script for Hexagon kernel
3e95bf452SRichard Kuo *
4f6b708c1SRichard Kuo * Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
5e95bf452SRichard Kuo *
6e95bf452SRichard Kuo * This program is free software; you can redistribute it and/or modify
7e95bf452SRichard Kuo * it under the terms of the GNU General Public License version 2 and
8e95bf452SRichard Kuo * only version 2 as published by the Free Software Foundation.
9e95bf452SRichard Kuo *
10e95bf452SRichard Kuo * This program is distributed in the hope that it will be useful,
11e95bf452SRichard Kuo * but WITHOUT ANY WARRANTY; without even the implied warranty of
12e95bf452SRichard Kuo * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13e95bf452SRichard Kuo * GNU General Public License for more details.
14e95bf452SRichard Kuo *
15e95bf452SRichard Kuo * You should have received a copy of the GNU General Public License
16e95bf452SRichard Kuo * along with this program; if not, write to the Free Software
17e95bf452SRichard Kuo * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18e95bf452SRichard Kuo * 02110-1301, USA.
19e95bf452SRichard Kuo */
20e95bf452SRichard Kuo
21e95bf452SRichard Kuo#include <asm-generic/vmlinux.lds.h>
22e95bf452SRichard Kuo#include <asm/asm-offsets.h>	/*  Most of the kernel defines are here  */
23e95bf452SRichard Kuo#include <asm/mem-layout.h>	/*  except for page_offset  */
24e95bf452SRichard Kuo#include <asm/cache.h>		/*  and now we're pulling cache line size  */
25*0b04ea68SDavid Howells#include <asm/thread_info.h>	/*  and we need THREAD_SIZE too */
26*0b04ea68SDavid Howells
27e95bf452SRichard KuoOUTPUT_ARCH(hexagon)
28e95bf452SRichard KuoENTRY(stext)
29e95bf452SRichard Kuo
30e95bf452SRichard Kuojiffies = jiffies_64;
31e95bf452SRichard Kuo
32e95bf452SRichard Kuo/*
33e95bf452SRichard KuoSee asm-generic/vmlinux.lds.h for expansion of some of these macros.
34e95bf452SRichard KuoSee asm-generic/sections.h for seemingly required labels.
35e95bf452SRichard Kuo*/
36e95bf452SRichard Kuo
37e95bf452SRichard Kuo#define PAGE_SIZE _PAGE_SIZE
38e95bf452SRichard Kuo
39e95bf452SRichard KuoSECTIONS
40e95bf452SRichard Kuo{
418f5a0b9dSRichard Kuo	. = PAGE_OFFSET;
42e95bf452SRichard Kuo
43e95bf452SRichard Kuo	__init_begin = .;
44e95bf452SRichard Kuo	HEAD_TEXT_SECTION
45e95bf452SRichard Kuo	INIT_TEXT_SECTION(PAGE_SIZE)
46e95bf452SRichard Kuo	PERCPU_SECTION(L1_CACHE_BYTES)
47e95bf452SRichard Kuo	__init_end = .;
48e95bf452SRichard Kuo
49e95bf452SRichard Kuo        . = ALIGN(_PAGE_SIZE);
50e95bf452SRichard Kuo	_stext = .;
518f5a0b9dSRichard Kuo	.text : AT(ADDR(.text)) {
52e95bf452SRichard Kuo		_text = .;
53e95bf452SRichard Kuo		TEXT_TEXT
54e95bf452SRichard Kuo		SCHED_TEXT
556727ad9eSChris Metcalf		CPUIDLE_TEXT
56e95bf452SRichard Kuo		LOCK_TEXT
57e95bf452SRichard Kuo		KPROBES_TEXT
58e95bf452SRichard Kuo		*(.fixup)
59e95bf452SRichard Kuo	}
60e95bf452SRichard Kuo	_etext = .;
61e95bf452SRichard Kuo
62e95bf452SRichard Kuo	INIT_DATA_SECTION(PAGE_SIZE)
63e95bf452SRichard Kuo
64e95bf452SRichard Kuo	_sdata = .;
65f6b708c1SRichard Kuo		RW_DATA_SECTION(32,PAGE_SIZE,_THREAD_SIZE)
66e95bf452SRichard Kuo		RO_DATA_SECTION(PAGE_SIZE)
67e95bf452SRichard Kuo	_edata = .;
68e95bf452SRichard Kuo
69e95bf452SRichard Kuo	EXCEPTION_TABLE(16)
70e95bf452SRichard Kuo	NOTES
71e95bf452SRichard Kuo
72e95bf452SRichard Kuo	BSS_SECTION(_PAGE_SIZE, _PAGE_SIZE, _PAGE_SIZE)
73e95bf452SRichard Kuo
74e95bf452SRichard Kuo	_end = .;
75e95bf452SRichard Kuo
76e95bf452SRichard Kuo	/DISCARD/ : {
77e95bf452SRichard Kuo		EXIT_TEXT
78e95bf452SRichard Kuo		EXIT_DATA
79e95bf452SRichard Kuo		EXIT_CALL
80e95bf452SRichard Kuo	}
81e95bf452SRichard Kuo
82e95bf452SRichard Kuo	STABS_DEBUG
83e95bf452SRichard Kuo	DWARF_DEBUG
84e95bf452SRichard Kuo
85e95bf452SRichard Kuo}
86