xref: /openbmc/linux/arch/sparc/kernel/vmlinux.lds.S (revision a7159a87a3836f61a97882e671d2d66bbb96c62e)
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
3649fa5230SDavid S. Miller#ifdef CONFIG_SPARC64
3749fa5230SDavid S. MillerASSERT((swapper_tsb == 0x0000000000408000), "Error: sparc64 early assembler too large")
3849fa5230SDavid S. Miller#endif
3949fa5230SDavid S. Miller
401da177e4SLinus TorvaldsSECTIONS
411da177e4SLinus Torvalds{
42d195b71bSDavid S. Miller#ifdef CONFIG_SPARC64
43d195b71bSDavid S. Miller	swapper_pg_dir = 0x0000000000402000;
44d195b71bSDavid S. Miller#endif
451b1fbbcaSSam Ravnborg	. = INITIAL_ADDRESS;
461b1fbbcaSSam Ravnborg	.text TEXTSTART :
471da177e4SLinus Torvalds	{
48fd593d12SEric W. Biederman		_text = .;
49ce8a7424STim Abbott		HEAD_TEXT
507664709bSSam Ravnborg		TEXT_TEXT
511da177e4SLinus Torvalds		SCHED_TEXT
526727ad9eSChris Metcalf		CPUIDLE_TEXT
531da177e4SLinus Torvalds		LOCK_TEXT
541b1fbbcaSSam Ravnborg		KPROBES_TEXT
559960e9e8SDavid S. Miller		IRQENTRY_TEXT
56be7635e7SAlexander Potapenko		SOFTIRQENTRY_TEXT
571da177e4SLinus Torvalds		*(.gnu.warning)
581da177e4SLinus Torvalds	} = 0
591da177e4SLinus Torvalds	_etext = .;
601b1fbbcaSSam Ravnborg
611b1fbbcaSSam Ravnborg	RO_DATA(PAGE_SIZE)
628b8d8e28SDavid S. Miller
638b8d8e28SDavid S. Miller	/* Start of data section */
648b8d8e28SDavid S. Miller	_sdata = .;
658b8d8e28SDavid S. Miller
66bcbe40ebSSam Ravnborg	.data1 : {
67bcbe40ebSSam Ravnborg		*(.data1)
68bcbe40ebSSam Ravnborg	}
693240a77bSGeoffrey Thomas	RW_DATA_SECTION(SMP_CACHE_BYTES, 0, THREAD_SIZE)
703240a77bSGeoffrey Thomas
71b74e34dbSSam Ravnborg	/* End of data section */
721da177e4SLinus Torvalds	_edata = .;
73b74e34dbSSam Ravnborg
74bcbe40ebSSam Ravnborg	.fixup : {
751da177e4SLinus Torvalds		__start___fixup = .;
76bcbe40ebSSam Ravnborg		*(.fixup)
771da177e4SLinus Torvalds		__stop___fixup = .;
78bcbe40ebSSam Ravnborg	}
793240a77bSGeoffrey Thomas	EXCEPTION_TABLE(16)
800c0d345eSDavid S. Miller	NOTES
810c0d345eSDavid S. Miller
82bcbe40ebSSam Ravnborg	. = ALIGN(PAGE_SIZE);
833240a77bSGeoffrey Thomas	__init_begin = ALIGN(PAGE_SIZE);
843240a77bSGeoffrey Thomas	INIT_TEXT_SECTION(PAGE_SIZE)
85bcbe40ebSSam Ravnborg	__init_text_end = .;
863240a77bSGeoffrey Thomas	INIT_DATA_SECTION(16)
8767d38229SJean-Paul Saman
881b1fbbcaSSam Ravnborg	. = ALIGN(4);
891b1fbbcaSSam Ravnborg	.tsb_ldquad_phys_patch : {
901b1fbbcaSSam Ravnborg		__tsb_ldquad_phys_patch = .;
911b1fbbcaSSam Ravnborg		*(.tsb_ldquad_phys_patch)
921b1fbbcaSSam Ravnborg		__tsb_ldquad_phys_patch_end = .;
931b1fbbcaSSam Ravnborg	}
941b1fbbcaSSam Ravnborg
951b1fbbcaSSam Ravnborg	.tsb_phys_patch : {
961b1fbbcaSSam Ravnborg		__tsb_phys_patch = .;
971b1fbbcaSSam Ravnborg		*(.tsb_phys_patch)
981b1fbbcaSSam Ravnborg		__tsb_phys_patch_end = .;
991b1fbbcaSSam Ravnborg	}
1001b1fbbcaSSam Ravnborg
1011b1fbbcaSSam Ravnborg	.cpuid_patch : {
1021b1fbbcaSSam Ravnborg		__cpuid_patch = .;
1031b1fbbcaSSam Ravnborg		*(.cpuid_patch)
1041b1fbbcaSSam Ravnborg		__cpuid_patch_end = .;
1051b1fbbcaSSam Ravnborg	}
1061b1fbbcaSSam Ravnborg
1071b1fbbcaSSam Ravnborg	.sun4v_1insn_patch : {
1081b1fbbcaSSam Ravnborg		__sun4v_1insn_patch = .;
1091b1fbbcaSSam Ravnborg		*(.sun4v_1insn_patch)
1101b1fbbcaSSam Ravnborg		__sun4v_1insn_patch_end = .;
1111b1fbbcaSSam Ravnborg	}
1121b1fbbcaSSam Ravnborg	.sun4v_2insn_patch : {
1131b1fbbcaSSam Ravnborg		__sun4v_2insn_patch = .;
1141b1fbbcaSSam Ravnborg		*(.sun4v_2insn_patch)
1151b1fbbcaSSam Ravnborg		__sun4v_2insn_patch_end = .;
1161b1fbbcaSSam Ravnborg	}
1175b8b93c4SSam Ravnborg	.leon_1insn_patch : {
1185b8b93c4SSam Ravnborg		__leon_1insn_patch = .;
1195b8b93c4SSam Ravnborg		*(.leon_1insn_patch)
1205b8b93c4SSam Ravnborg		__leon_1insn_patch_end = .;
1215b8b93c4SSam Ravnborg	}
1229076d0e7SDavid S. Miller	.swapper_tsb_phys_patch : {
1239076d0e7SDavid S. Miller		__swapper_tsb_phys_patch = .;
1249076d0e7SDavid S. Miller		*(.swapper_tsb_phys_patch)
1259076d0e7SDavid S. Miller		__swapper_tsb_phys_patch_end = .;
1269076d0e7SDavid S. Miller	}
1279076d0e7SDavid S. Miller	.swapper_4m_tsb_phys_patch : {
1289076d0e7SDavid S. Miller		__swapper_4m_tsb_phys_patch = .;
1299076d0e7SDavid S. Miller		*(.swapper_4m_tsb_phys_patch)
1309076d0e7SDavid S. Miller		__swapper_4m_tsb_phys_patch_end = .;
1319076d0e7SDavid S. Miller	}
132ef7c4d46SDavid S. Miller	.popc_3insn_patch : {
133ef7c4d46SDavid S. Miller		__popc_3insn_patch = .;
134ef7c4d46SDavid S. Miller		*(.popc_3insn_patch)
135ef7c4d46SDavid S. Miller		__popc_3insn_patch_end = .;
136ef7c4d46SDavid S. Miller	}
13756d205ccSDavid S. Miller	.popc_6insn_patch : {
13856d205ccSDavid S. Miller		__popc_6insn_patch = .;
13956d205ccSDavid S. Miller		*(.popc_6insn_patch)
14056d205ccSDavid S. Miller		__popc_6insn_patch_end = .;
14156d205ccSDavid S. Miller	}
142187818cdSDavid S. Miller	.pause_3insn_patch : {
143187818cdSDavid S. Miller		__pause_3insn_patch = .;
144187818cdSDavid S. Miller		*(.pause_3insn_patch)
145187818cdSDavid S. Miller		__pause_3insn_patch_end = .;
146e9b9eb59SDavid S. Miller	}
147494e5b6fSKhalid Aziz	.sun_m7_2insn_patch : {
148494e5b6fSKhalid Aziz		__sun_m7_2insn_patch = .;
149494e5b6fSKhalid Aziz		*(.sun_m7_2insn_patch)
150494e5b6fSKhalid Aziz		__sun_m7_2insn_patch_end = .;
151494e5b6fSKhalid Aziz	}
1524929c83aSPavel Tatashin	.get_tick_patch : {
1534929c83aSPavel Tatashin		__get_tick_patch = .;
1544929c83aSPavel Tatashin		*(.get_tick_patch)
1554929c83aSPavel Tatashin		__get_tick_patch_end = .;
1564929c83aSPavel Tatashin	}
157df7b2155SNitin Gupta	.pud_huge_patch : {
158df7b2155SNitin Gupta		__pud_huge_patch = .;
159df7b2155SNitin Gupta		*(.pud_huge_patch)
160df7b2155SNitin Gupta		__pud_huge_patch_end = .;
161df7b2155SNitin Gupta	}
162*a7159a87SAnthony Yznaga	.fast_win_ctrl_1insn_patch : {
163*a7159a87SAnthony Yznaga		__fast_win_ctrl_1insn_patch = .;
164*a7159a87SAnthony Yznaga		*(.fast_win_ctrl_1insn_patch)
165*a7159a87SAnthony Yznaga		__fast_win_ctrl_1insn_patch_end = .;
166*a7159a87SAnthony Yznaga	}
1670415b00dSTejun Heo	PERCPU_SECTION(SMP_CACHE_BYTES)
1681b1fbbcaSSam Ravnborg
16910d7227bSJason Baron#ifdef CONFIG_JUMP_LABEL
17010d7227bSJason Baron	. = ALIGN(PAGE_SIZE);
17110d7227bSJason Baron	.exit.text : {
17210d7227bSJason Baron		EXIT_TEXT
17310d7227bSJason Baron	}
17410d7227bSJason Baron#endif
17510d7227bSJason Baron
176bcbe40ebSSam Ravnborg	. = ALIGN(PAGE_SIZE);
1771da177e4SLinus Torvalds	__init_end = .;
1783240a77bSGeoffrey Thomas	BSS_SECTION(0, 0, 0)
1791da177e4SLinus Torvalds	_end = . ;
1801b1fbbcaSSam Ravnborg
181d5784b57SDavid S. Miller	STABS_DEBUG
182d5784b57SDavid S. Miller	DWARF_DEBUG
183023bf6f1STejun Heo
184023bf6f1STejun Heo	DISCARDS
1851da177e4SLinus Torvalds}
186