xref: /openbmc/linux/arch/sparc/kernel/vmlinux.lds.S (revision ef7c4d4675d2a9206f913f26ca1a5cd41bff9d41)
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{
381b1fbbcaSSam Ravnborg	/* swapper_low_pmd_dir is sparc64 only */
391b1fbbcaSSam Ravnborg	swapper_low_pmd_dir = 0x0000000000402000;
401b1fbbcaSSam Ravnborg	. = INITIAL_ADDRESS;
411b1fbbcaSSam Ravnborg	.text TEXTSTART :
421da177e4SLinus Torvalds	{
43fd593d12SEric W. Biederman		_text = .;
44ce8a7424STim Abbott		HEAD_TEXT
457664709bSSam Ravnborg		TEXT_TEXT
461da177e4SLinus Torvalds		SCHED_TEXT
471da177e4SLinus Torvalds		LOCK_TEXT
481b1fbbcaSSam Ravnborg		KPROBES_TEXT
499960e9e8SDavid S. Miller		IRQENTRY_TEXT
501da177e4SLinus Torvalds		*(.gnu.warning)
511da177e4SLinus Torvalds	} = 0
521da177e4SLinus Torvalds	_etext = .;
531b1fbbcaSSam Ravnborg
541b1fbbcaSSam Ravnborg	RO_DATA(PAGE_SIZE)
558b8d8e28SDavid S. Miller
568b8d8e28SDavid S. Miller	/* Start of data section */
578b8d8e28SDavid S. Miller	_sdata = .;
588b8d8e28SDavid S. Miller
59bcbe40ebSSam Ravnborg	.data1 : {
60bcbe40ebSSam Ravnborg		*(.data1)
61bcbe40ebSSam Ravnborg	}
623240a77bSGeoffrey Thomas	RW_DATA_SECTION(SMP_CACHE_BYTES, 0, THREAD_SIZE)
633240a77bSGeoffrey Thomas
64b74e34dbSSam Ravnborg	/* End of data section */
651da177e4SLinus Torvalds	_edata = .;
66b74e34dbSSam Ravnborg
67bcbe40ebSSam Ravnborg	.fixup : {
681da177e4SLinus Torvalds		__start___fixup = .;
69bcbe40ebSSam Ravnborg		*(.fixup)
701da177e4SLinus Torvalds		__stop___fixup = .;
71bcbe40ebSSam Ravnborg	}
723240a77bSGeoffrey Thomas	EXCEPTION_TABLE(16)
730c0d345eSDavid S. Miller	NOTES
740c0d345eSDavid S. Miller
75bcbe40ebSSam Ravnborg	. = ALIGN(PAGE_SIZE);
763240a77bSGeoffrey Thomas	__init_begin = ALIGN(PAGE_SIZE);
773240a77bSGeoffrey Thomas	INIT_TEXT_SECTION(PAGE_SIZE)
78bcbe40ebSSam Ravnborg	__init_text_end = .;
793240a77bSGeoffrey Thomas	INIT_DATA_SECTION(16)
8067d38229SJean-Paul Saman
811b1fbbcaSSam Ravnborg	. = ALIGN(4);
821b1fbbcaSSam Ravnborg	.tsb_ldquad_phys_patch : {
831b1fbbcaSSam Ravnborg		__tsb_ldquad_phys_patch = .;
841b1fbbcaSSam Ravnborg		*(.tsb_ldquad_phys_patch)
851b1fbbcaSSam Ravnborg		__tsb_ldquad_phys_patch_end = .;
861b1fbbcaSSam Ravnborg	}
871b1fbbcaSSam Ravnborg
881b1fbbcaSSam Ravnborg	.tsb_phys_patch : {
891b1fbbcaSSam Ravnborg		__tsb_phys_patch = .;
901b1fbbcaSSam Ravnborg		*(.tsb_phys_patch)
911b1fbbcaSSam Ravnborg		__tsb_phys_patch_end = .;
921b1fbbcaSSam Ravnborg	}
931b1fbbcaSSam Ravnborg
941b1fbbcaSSam Ravnborg	.cpuid_patch : {
951b1fbbcaSSam Ravnborg		__cpuid_patch = .;
961b1fbbcaSSam Ravnborg		*(.cpuid_patch)
971b1fbbcaSSam Ravnborg		__cpuid_patch_end = .;
981b1fbbcaSSam Ravnborg	}
991b1fbbcaSSam Ravnborg
1001b1fbbcaSSam Ravnborg	.sun4v_1insn_patch : {
1011b1fbbcaSSam Ravnborg		__sun4v_1insn_patch = .;
1021b1fbbcaSSam Ravnborg		*(.sun4v_1insn_patch)
1031b1fbbcaSSam Ravnborg		__sun4v_1insn_patch_end = .;
1041b1fbbcaSSam Ravnborg	}
1051b1fbbcaSSam Ravnborg	.sun4v_2insn_patch : {
1061b1fbbcaSSam Ravnborg		__sun4v_2insn_patch = .;
1071b1fbbcaSSam Ravnborg		*(.sun4v_2insn_patch)
1081b1fbbcaSSam Ravnborg		__sun4v_2insn_patch_end = .;
1091b1fbbcaSSam Ravnborg	}
110*ef7c4d46SDavid S. Miller	.popc_3insn_patch : {
111*ef7c4d46SDavid S. Miller		__popc_3insn_patch = .;
112*ef7c4d46SDavid S. Miller		*(.popc_3insn_patch)
113*ef7c4d46SDavid S. Miller		__popc_3insn_patch_end = .;
114*ef7c4d46SDavid S. Miller	}
1150415b00dSTejun Heo	PERCPU_SECTION(SMP_CACHE_BYTES)
1161b1fbbcaSSam Ravnborg
117bcbe40ebSSam Ravnborg	. = ALIGN(PAGE_SIZE);
1181da177e4SLinus Torvalds	__init_end = .;
1193240a77bSGeoffrey Thomas	BSS_SECTION(0, 0, 0)
1201da177e4SLinus Torvalds	_end = . ;
1211b1fbbcaSSam Ravnborg
122d5784b57SDavid S. Miller	STABS_DEBUG
123d5784b57SDavid S. Miller	DWARF_DEBUG
124023bf6f1STejun Heo
125023bf6f1STejun Heo	DISCARDS
1261da177e4SLinus Torvalds}
127