xref: /openbmc/linux/arch/sparc/kernel/vmlinux.lds.S (revision be7635e7287e0e8013af3c89a6354a9e0182594c)
11b1fbbcaSSam Ravnborg/* ld script for sparc32/sparc64 kernel */
21da177e4SLinus Torvalds
31da177e4SLinus Torvalds#include <asm-generic/vmlinux.lds.h>
4b74e34dbSSam Ravnborg
5bcbe40ebSSam Ravnborg#include <asm/page.h>
6b74e34dbSSam Ravnborg#include <asm/thread_info.h>
71da177e4SLinus Torvalds
81b1fbbcaSSam Ravnborg#ifdef CONFIG_SPARC32
91b1fbbcaSSam Ravnborg#define INITIAL_ADDRESS  0x10000 + SIZEOF_HEADERS
101b1fbbcaSSam Ravnborg#define TEXTSTART	0xf0004000
111b1fbbcaSSam Ravnborg
121b1fbbcaSSam Ravnborg#define SMP_CACHE_BYTES_SHIFT 5
131b1fbbcaSSam Ravnborg
141b1fbbcaSSam Ravnborg#else
151b1fbbcaSSam Ravnborg#define SMP_CACHE_BYTES_SHIFT 6
161b1fbbcaSSam Ravnborg#define INITIAL_ADDRESS 0x4000
171b1fbbcaSSam Ravnborg#define TEXTSTART      0x0000000000404000
181b1fbbcaSSam Ravnborg
191b1fbbcaSSam Ravnborg#endif
201b1fbbcaSSam Ravnborg
211b1fbbcaSSam Ravnborg#define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT)
221b1fbbcaSSam Ravnborg
231b1fbbcaSSam Ravnborg#ifdef CONFIG_SPARC32
241da177e4SLinus TorvaldsOUTPUT_FORMAT("elf32-sparc", "elf32-sparc", "elf32-sparc")
251da177e4SLinus TorvaldsOUTPUT_ARCH(sparc)
261da177e4SLinus TorvaldsENTRY(_start)
271da177e4SLinus Torvaldsjiffies = jiffies_64 + 4;
281b1fbbcaSSam Ravnborg#else
291b1fbbcaSSam Ravnborg/* sparc64 */
301b1fbbcaSSam RavnborgOUTPUT_FORMAT("elf64-sparc", "elf64-sparc", "elf64-sparc")
311b1fbbcaSSam RavnborgOUTPUT_ARCH(sparc:v9a)
321b1fbbcaSSam RavnborgENTRY(_start)
331b1fbbcaSSam Ravnborgjiffies = jiffies_64;
341b1fbbcaSSam Ravnborg#endif
351b1fbbcaSSam Ravnborg
361da177e4SLinus TorvaldsSECTIONS
371da177e4SLinus Torvalds{
38d195b71bSDavid S. Miller#ifdef CONFIG_SPARC64
39d195b71bSDavid S. Miller	swapper_pg_dir = 0x0000000000402000;
40d195b71bSDavid S. Miller#endif
411b1fbbcaSSam Ravnborg	. = INITIAL_ADDRESS;
421b1fbbcaSSam Ravnborg	.text TEXTSTART :
431da177e4SLinus Torvalds	{
44fd593d12SEric W. Biederman		_text = .;
45ce8a7424STim Abbott		HEAD_TEXT
467664709bSSam Ravnborg		TEXT_TEXT
471da177e4SLinus Torvalds		SCHED_TEXT
481da177e4SLinus Torvalds		LOCK_TEXT
491b1fbbcaSSam Ravnborg		KPROBES_TEXT
509960e9e8SDavid S. Miller		IRQENTRY_TEXT
51*be7635e7SAlexander Potapenko		SOFTIRQENTRY_TEXT
521da177e4SLinus Torvalds		*(.gnu.warning)
531da177e4SLinus Torvalds	} = 0
541da177e4SLinus Torvalds	_etext = .;
551b1fbbcaSSam Ravnborg
561b1fbbcaSSam Ravnborg	RO_DATA(PAGE_SIZE)
578b8d8e28SDavid S. Miller
588b8d8e28SDavid S. Miller	/* Start of data section */
598b8d8e28SDavid S. Miller	_sdata = .;
608b8d8e28SDavid S. Miller
61bcbe40ebSSam Ravnborg	.data1 : {
62bcbe40ebSSam Ravnborg		*(.data1)
63bcbe40ebSSam Ravnborg	}
643240a77bSGeoffrey Thomas	RW_DATA_SECTION(SMP_CACHE_BYTES, 0, THREAD_SIZE)
653240a77bSGeoffrey Thomas
66b74e34dbSSam Ravnborg	/* End of data section */
671da177e4SLinus Torvalds	_edata = .;
68b74e34dbSSam Ravnborg
69bcbe40ebSSam Ravnborg	.fixup : {
701da177e4SLinus Torvalds		__start___fixup = .;
71bcbe40ebSSam Ravnborg		*(.fixup)
721da177e4SLinus Torvalds		__stop___fixup = .;
73bcbe40ebSSam Ravnborg	}
743240a77bSGeoffrey Thomas	EXCEPTION_TABLE(16)
750c0d345eSDavid S. Miller	NOTES
760c0d345eSDavid S. Miller
77bcbe40ebSSam Ravnborg	. = ALIGN(PAGE_SIZE);
783240a77bSGeoffrey Thomas	__init_begin = ALIGN(PAGE_SIZE);
793240a77bSGeoffrey Thomas	INIT_TEXT_SECTION(PAGE_SIZE)
80bcbe40ebSSam Ravnborg	__init_text_end = .;
813240a77bSGeoffrey Thomas	INIT_DATA_SECTION(16)
8267d38229SJean-Paul Saman
831b1fbbcaSSam Ravnborg	. = ALIGN(4);
841b1fbbcaSSam Ravnborg	.tsb_ldquad_phys_patch : {
851b1fbbcaSSam Ravnborg		__tsb_ldquad_phys_patch = .;
861b1fbbcaSSam Ravnborg		*(.tsb_ldquad_phys_patch)
871b1fbbcaSSam Ravnborg		__tsb_ldquad_phys_patch_end = .;
881b1fbbcaSSam Ravnborg	}
891b1fbbcaSSam Ravnborg
901b1fbbcaSSam Ravnborg	.tsb_phys_patch : {
911b1fbbcaSSam Ravnborg		__tsb_phys_patch = .;
921b1fbbcaSSam Ravnborg		*(.tsb_phys_patch)
931b1fbbcaSSam Ravnborg		__tsb_phys_patch_end = .;
941b1fbbcaSSam Ravnborg	}
951b1fbbcaSSam Ravnborg
961b1fbbcaSSam Ravnborg	.cpuid_patch : {
971b1fbbcaSSam Ravnborg		__cpuid_patch = .;
981b1fbbcaSSam Ravnborg		*(.cpuid_patch)
991b1fbbcaSSam Ravnborg		__cpuid_patch_end = .;
1001b1fbbcaSSam Ravnborg	}
1011b1fbbcaSSam Ravnborg
1021b1fbbcaSSam Ravnborg	.sun4v_1insn_patch : {
1031b1fbbcaSSam Ravnborg		__sun4v_1insn_patch = .;
1041b1fbbcaSSam Ravnborg		*(.sun4v_1insn_patch)
1051b1fbbcaSSam Ravnborg		__sun4v_1insn_patch_end = .;
1061b1fbbcaSSam Ravnborg	}
1071b1fbbcaSSam Ravnborg	.sun4v_2insn_patch : {
1081b1fbbcaSSam Ravnborg		__sun4v_2insn_patch = .;
1091b1fbbcaSSam Ravnborg		*(.sun4v_2insn_patch)
1101b1fbbcaSSam Ravnborg		__sun4v_2insn_patch_end = .;
1111b1fbbcaSSam Ravnborg	}
1125b8b93c4SSam Ravnborg	.leon_1insn_patch : {
1135b8b93c4SSam Ravnborg		__leon_1insn_patch = .;
1145b8b93c4SSam Ravnborg		*(.leon_1insn_patch)
1155b8b93c4SSam Ravnborg		__leon_1insn_patch_end = .;
1165b8b93c4SSam Ravnborg	}
1179076d0e7SDavid S. Miller	.swapper_tsb_phys_patch : {
1189076d0e7SDavid S. Miller		__swapper_tsb_phys_patch = .;
1199076d0e7SDavid S. Miller		*(.swapper_tsb_phys_patch)
1209076d0e7SDavid S. Miller		__swapper_tsb_phys_patch_end = .;
1219076d0e7SDavid S. Miller	}
1229076d0e7SDavid S. Miller	.swapper_4m_tsb_phys_patch : {
1239076d0e7SDavid S. Miller		__swapper_4m_tsb_phys_patch = .;
1249076d0e7SDavid S. Miller		*(.swapper_4m_tsb_phys_patch)
1259076d0e7SDavid S. Miller		__swapper_4m_tsb_phys_patch_end = .;
1269076d0e7SDavid S. Miller	}
127ef7c4d46SDavid S. Miller	.popc_3insn_patch : {
128ef7c4d46SDavid S. Miller		__popc_3insn_patch = .;
129ef7c4d46SDavid S. Miller		*(.popc_3insn_patch)
130ef7c4d46SDavid S. Miller		__popc_3insn_patch_end = .;
131ef7c4d46SDavid S. Miller	}
13256d205ccSDavid S. Miller	.popc_6insn_patch : {
13356d205ccSDavid S. Miller		__popc_6insn_patch = .;
13456d205ccSDavid S. Miller		*(.popc_6insn_patch)
13556d205ccSDavid S. Miller		__popc_6insn_patch_end = .;
13656d205ccSDavid S. Miller	}
137187818cdSDavid S. Miller	.pause_3insn_patch : {
138187818cdSDavid S. Miller		__pause_3insn_patch = .;
139187818cdSDavid S. Miller		*(.pause_3insn_patch)
140187818cdSDavid S. Miller		__pause_3insn_patch_end = .;
141e9b9eb59SDavid S. Miller	}
142494e5b6fSKhalid Aziz	.sun_m7_2insn_patch : {
143494e5b6fSKhalid Aziz		__sun_m7_2insn_patch = .;
144494e5b6fSKhalid Aziz		*(.sun_m7_2insn_patch)
145494e5b6fSKhalid Aziz		__sun_m7_2insn_patch_end = .;
146494e5b6fSKhalid Aziz	}
1470415b00dSTejun Heo	PERCPU_SECTION(SMP_CACHE_BYTES)
1481b1fbbcaSSam Ravnborg
149bcbe40ebSSam Ravnborg	. = ALIGN(PAGE_SIZE);
1501da177e4SLinus Torvalds	__init_end = .;
1513240a77bSGeoffrey Thomas	BSS_SECTION(0, 0, 0)
1521da177e4SLinus Torvalds	_end = . ;
1531b1fbbcaSSam Ravnborg
154d5784b57SDavid S. Miller	STABS_DEBUG
155d5784b57SDavid S. Miller	DWARF_DEBUG
156023bf6f1STejun Heo
157023bf6f1STejun Heo	DISCARDS
1581da177e4SLinus Torvalds}
159