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 = .; 44*ce8a7424STim Abbott HEAD_TEXT 457664709bSSam Ravnborg TEXT_TEXT 461da177e4SLinus Torvalds SCHED_TEXT 471da177e4SLinus Torvalds LOCK_TEXT 481b1fbbcaSSam Ravnborg KPROBES_TEXT 491da177e4SLinus Torvalds *(.gnu.warning) 501da177e4SLinus Torvalds } = 0 511da177e4SLinus Torvalds _etext = .; 521b1fbbcaSSam Ravnborg 531b1fbbcaSSam Ravnborg RO_DATA(PAGE_SIZE) 54bcbe40ebSSam Ravnborg .data : { 55ca967258SSam Ravnborg DATA_DATA 561da177e4SLinus Torvalds CONSTRUCTORS 571da177e4SLinus Torvalds } 58bcbe40ebSSam Ravnborg .data1 : { 59bcbe40ebSSam Ravnborg *(.data1) 60bcbe40ebSSam Ravnborg } 611b1fbbcaSSam Ravnborg . = ALIGN(SMP_CACHE_BYTES); 621b1fbbcaSSam Ravnborg .data.cacheline_aligned : { 631b1fbbcaSSam Ravnborg *(.data.cacheline_aligned) 641b1fbbcaSSam Ravnborg } 651b1fbbcaSSam Ravnborg . = ALIGN(SMP_CACHE_BYTES); 661b1fbbcaSSam Ravnborg .data.read_mostly : { 671b1fbbcaSSam Ravnborg *(.data.read_mostly) 681b1fbbcaSSam Ravnborg } 69b74e34dbSSam Ravnborg /* End of data section */ 701da177e4SLinus Torvalds _edata = .; 71b74e34dbSSam Ravnborg 72b74e34dbSSam Ravnborg /* init_task */ 73b74e34dbSSam Ravnborg . = ALIGN(THREAD_SIZE); 74b74e34dbSSam Ravnborg .data.init_task : { 75b74e34dbSSam Ravnborg *(.data.init_task) 76b74e34dbSSam Ravnborg } 77bcbe40ebSSam Ravnborg .fixup : { 781da177e4SLinus Torvalds __start___fixup = .; 79bcbe40ebSSam Ravnborg *(.fixup) 801da177e4SLinus Torvalds __stop___fixup = .; 81bcbe40ebSSam Ravnborg } 821b1fbbcaSSam Ravnborg . = ALIGN(16); 83bcbe40ebSSam Ravnborg __ex_table : { 841da177e4SLinus Torvalds __start___ex_table = .; 85bcbe40ebSSam Ravnborg *(__ex_table) 861da177e4SLinus Torvalds __stop___ex_table = .; 87bcbe40ebSSam Ravnborg } 880c0d345eSDavid S. Miller NOTES 890c0d345eSDavid S. Miller 90bcbe40ebSSam Ravnborg . = ALIGN(PAGE_SIZE); 91ab5da288SMartin Habets .init.text : { 921b1fbbcaSSam Ravnborg __init_begin = .; 93bcbe40ebSSam Ravnborg _sinittext = .; 9401ba2bdcSSam Ravnborg INIT_TEXT 95ab5da288SMartin Habets _einittext = .; 961da177e4SLinus Torvalds } 97bcbe40ebSSam Ravnborg __init_text_end = .; 98bcbe40ebSSam Ravnborg .init.data : { 9901ba2bdcSSam Ravnborg INIT_DATA 100bcbe40ebSSam Ravnborg } 101bcbe40ebSSam Ravnborg . = ALIGN(16); 102bcbe40ebSSam Ravnborg .init.setup : { 103bcbe40ebSSam Ravnborg __setup_start = .; 104bcbe40ebSSam Ravnborg *(.init.setup) 105bcbe40ebSSam Ravnborg __setup_end = .; 106bcbe40ebSSam Ravnborg } 107bcbe40ebSSam Ravnborg .initcall.init : { 108bcbe40ebSSam Ravnborg __initcall_start = .; 109bcbe40ebSSam Ravnborg INITCALLS 1101da177e4SLinus Torvalds __initcall_end = .; 111bcbe40ebSSam Ravnborg } 112bcbe40ebSSam Ravnborg .con_initcall.init : { 1131da177e4SLinus Torvalds __con_initcall_start = .; 114bcbe40ebSSam Ravnborg *(.con_initcall.init) 1151da177e4SLinus Torvalds __con_initcall_end = .; 116bcbe40ebSSam Ravnborg } 1171da177e4SLinus Torvalds SECURITY_INIT 11867d38229SJean-Paul Saman 1191b1fbbcaSSam Ravnborg . = ALIGN(4); 1201b1fbbcaSSam Ravnborg .tsb_ldquad_phys_patch : { 1211b1fbbcaSSam Ravnborg __tsb_ldquad_phys_patch = .; 1221b1fbbcaSSam Ravnborg *(.tsb_ldquad_phys_patch) 1231b1fbbcaSSam Ravnborg __tsb_ldquad_phys_patch_end = .; 1241b1fbbcaSSam Ravnborg } 1251b1fbbcaSSam Ravnborg 1261b1fbbcaSSam Ravnborg .tsb_phys_patch : { 1271b1fbbcaSSam Ravnborg __tsb_phys_patch = .; 1281b1fbbcaSSam Ravnborg *(.tsb_phys_patch) 1291b1fbbcaSSam Ravnborg __tsb_phys_patch_end = .; 1301b1fbbcaSSam Ravnborg } 1311b1fbbcaSSam Ravnborg 1321b1fbbcaSSam Ravnborg .cpuid_patch : { 1331b1fbbcaSSam Ravnborg __cpuid_patch = .; 1341b1fbbcaSSam Ravnborg *(.cpuid_patch) 1351b1fbbcaSSam Ravnborg __cpuid_patch_end = .; 1361b1fbbcaSSam Ravnborg } 1371b1fbbcaSSam Ravnborg 1381b1fbbcaSSam Ravnborg .sun4v_1insn_patch : { 1391b1fbbcaSSam Ravnborg __sun4v_1insn_patch = .; 1401b1fbbcaSSam Ravnborg *(.sun4v_1insn_patch) 1411b1fbbcaSSam Ravnborg __sun4v_1insn_patch_end = .; 1421b1fbbcaSSam Ravnborg } 1431b1fbbcaSSam Ravnborg .sun4v_2insn_patch : { 1441b1fbbcaSSam Ravnborg __sun4v_2insn_patch = .; 1451b1fbbcaSSam Ravnborg *(.sun4v_2insn_patch) 1461b1fbbcaSSam Ravnborg __sun4v_2insn_patch_end = .; 1471b1fbbcaSSam Ravnborg } 1481b1fbbcaSSam Ravnborg 14967d38229SJean-Paul Saman#ifdef CONFIG_BLK_DEV_INITRD 150bcbe40ebSSam Ravnborg . = ALIGN(PAGE_SIZE); 151bcbe40ebSSam Ravnborg .init.ramfs : { 1521da177e4SLinus Torvalds __initramfs_start = .; 153bcbe40ebSSam Ravnborg *(.init.ramfs) 1541da177e4SLinus Torvalds __initramfs_end = .; 155bcbe40ebSSam Ravnborg } 15667d38229SJean-Paul Saman#endif 15767d38229SJean-Paul Saman 158bcbe40ebSSam Ravnborg PERCPU(PAGE_SIZE) 1591b1fbbcaSSam Ravnborg 160bcbe40ebSSam Ravnborg . = ALIGN(PAGE_SIZE); 1611da177e4SLinus Torvalds __init_end = .; 1621da177e4SLinus Torvalds __bss_start = .; 163bcbe40ebSSam Ravnborg .sbss : { 164bcbe40ebSSam Ravnborg *(.sbss) 1651b1fbbcaSSam Ravnborg *(.scommon) 1661b1fbbcaSSam Ravnborg } 167bcbe40ebSSam Ravnborg .bss : { 1681da177e4SLinus Torvalds *(.dynbss) 1691da177e4SLinus Torvalds *(.bss) 1701da177e4SLinus Torvalds *(COMMON) 1711da177e4SLinus Torvalds } 1721da177e4SLinus Torvalds _end = . ; 1731b1fbbcaSSam Ravnborg 174bcbe40ebSSam Ravnborg /DISCARD/ : { 17501ba2bdcSSam Ravnborg EXIT_TEXT 17601ba2bdcSSam Ravnborg EXIT_DATA 177bcbe40ebSSam Ravnborg *(.exitcall.exit) 178bcbe40ebSSam Ravnborg } 179d5784b57SDavid S. Miller 180d5784b57SDavid S. Miller STABS_DEBUG 181d5784b57SDavid S. Miller DWARF_DEBUG 1821da177e4SLinus Torvalds} 183