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 521da177e4SLinus Torvalds LOCK_TEXT 531b1fbbcaSSam Ravnborg KPROBES_TEXT 549960e9e8SDavid S. Miller IRQENTRY_TEXT 55be7635e7SAlexander Potapenko SOFTIRQENTRY_TEXT 561da177e4SLinus Torvalds *(.gnu.warning) 571da177e4SLinus Torvalds } = 0 581da177e4SLinus Torvalds _etext = .; 591b1fbbcaSSam Ravnborg 601b1fbbcaSSam Ravnborg RO_DATA(PAGE_SIZE) 618b8d8e28SDavid S. Miller 628b8d8e28SDavid S. Miller /* Start of data section */ 638b8d8e28SDavid S. Miller _sdata = .; 648b8d8e28SDavid S. Miller 65bcbe40ebSSam Ravnborg .data1 : { 66bcbe40ebSSam Ravnborg *(.data1) 67bcbe40ebSSam Ravnborg } 683240a77bSGeoffrey Thomas RW_DATA_SECTION(SMP_CACHE_BYTES, 0, THREAD_SIZE) 693240a77bSGeoffrey Thomas 70b74e34dbSSam Ravnborg /* End of data section */ 711da177e4SLinus Torvalds _edata = .; 72b74e34dbSSam Ravnborg 73bcbe40ebSSam Ravnborg .fixup : { 741da177e4SLinus Torvalds __start___fixup = .; 75bcbe40ebSSam Ravnborg *(.fixup) 761da177e4SLinus Torvalds __stop___fixup = .; 77bcbe40ebSSam Ravnborg } 783240a77bSGeoffrey Thomas EXCEPTION_TABLE(16) 790c0d345eSDavid S. Miller NOTES 800c0d345eSDavid S. Miller 81bcbe40ebSSam Ravnborg . = ALIGN(PAGE_SIZE); 823240a77bSGeoffrey Thomas __init_begin = ALIGN(PAGE_SIZE); 833240a77bSGeoffrey Thomas INIT_TEXT_SECTION(PAGE_SIZE) 84bcbe40ebSSam Ravnborg __init_text_end = .; 853240a77bSGeoffrey Thomas INIT_DATA_SECTION(16) 8667d38229SJean-Paul Saman 871b1fbbcaSSam Ravnborg . = ALIGN(4); 881b1fbbcaSSam Ravnborg .tsb_ldquad_phys_patch : { 891b1fbbcaSSam Ravnborg __tsb_ldquad_phys_patch = .; 901b1fbbcaSSam Ravnborg *(.tsb_ldquad_phys_patch) 911b1fbbcaSSam Ravnborg __tsb_ldquad_phys_patch_end = .; 921b1fbbcaSSam Ravnborg } 931b1fbbcaSSam Ravnborg 941b1fbbcaSSam Ravnborg .tsb_phys_patch : { 951b1fbbcaSSam Ravnborg __tsb_phys_patch = .; 961b1fbbcaSSam Ravnborg *(.tsb_phys_patch) 971b1fbbcaSSam Ravnborg __tsb_phys_patch_end = .; 981b1fbbcaSSam Ravnborg } 991b1fbbcaSSam Ravnborg 1001b1fbbcaSSam Ravnborg .cpuid_patch : { 1011b1fbbcaSSam Ravnborg __cpuid_patch = .; 1021b1fbbcaSSam Ravnborg *(.cpuid_patch) 1031b1fbbcaSSam Ravnborg __cpuid_patch_end = .; 1041b1fbbcaSSam Ravnborg } 1051b1fbbcaSSam Ravnborg 1061b1fbbcaSSam Ravnborg .sun4v_1insn_patch : { 1071b1fbbcaSSam Ravnborg __sun4v_1insn_patch = .; 1081b1fbbcaSSam Ravnborg *(.sun4v_1insn_patch) 1091b1fbbcaSSam Ravnborg __sun4v_1insn_patch_end = .; 1101b1fbbcaSSam Ravnborg } 1111b1fbbcaSSam Ravnborg .sun4v_2insn_patch : { 1121b1fbbcaSSam Ravnborg __sun4v_2insn_patch = .; 1131b1fbbcaSSam Ravnborg *(.sun4v_2insn_patch) 1141b1fbbcaSSam Ravnborg __sun4v_2insn_patch_end = .; 1151b1fbbcaSSam Ravnborg } 1165b8b93c4SSam Ravnborg .leon_1insn_patch : { 1175b8b93c4SSam Ravnborg __leon_1insn_patch = .; 1185b8b93c4SSam Ravnborg *(.leon_1insn_patch) 1195b8b93c4SSam Ravnborg __leon_1insn_patch_end = .; 1205b8b93c4SSam Ravnborg } 1219076d0e7SDavid S. Miller .swapper_tsb_phys_patch : { 1229076d0e7SDavid S. Miller __swapper_tsb_phys_patch = .; 1239076d0e7SDavid S. Miller *(.swapper_tsb_phys_patch) 1249076d0e7SDavid S. Miller __swapper_tsb_phys_patch_end = .; 1259076d0e7SDavid S. Miller } 1269076d0e7SDavid S. Miller .swapper_4m_tsb_phys_patch : { 1279076d0e7SDavid S. Miller __swapper_4m_tsb_phys_patch = .; 1289076d0e7SDavid S. Miller *(.swapper_4m_tsb_phys_patch) 1299076d0e7SDavid S. Miller __swapper_4m_tsb_phys_patch_end = .; 1309076d0e7SDavid S. Miller } 131ef7c4d46SDavid S. Miller .popc_3insn_patch : { 132ef7c4d46SDavid S. Miller __popc_3insn_patch = .; 133ef7c4d46SDavid S. Miller *(.popc_3insn_patch) 134ef7c4d46SDavid S. Miller __popc_3insn_patch_end = .; 135ef7c4d46SDavid S. Miller } 13656d205ccSDavid S. Miller .popc_6insn_patch : { 13756d205ccSDavid S. Miller __popc_6insn_patch = .; 13856d205ccSDavid S. Miller *(.popc_6insn_patch) 13956d205ccSDavid S. Miller __popc_6insn_patch_end = .; 14056d205ccSDavid S. Miller } 141187818cdSDavid S. Miller .pause_3insn_patch : { 142187818cdSDavid S. Miller __pause_3insn_patch = .; 143187818cdSDavid S. Miller *(.pause_3insn_patch) 144187818cdSDavid S. Miller __pause_3insn_patch_end = .; 145e9b9eb59SDavid S. Miller } 146494e5b6fSKhalid Aziz .sun_m7_2insn_patch : { 147494e5b6fSKhalid Aziz __sun_m7_2insn_patch = .; 148494e5b6fSKhalid Aziz *(.sun_m7_2insn_patch) 149494e5b6fSKhalid Aziz __sun_m7_2insn_patch_end = .; 150494e5b6fSKhalid Aziz } 1510415b00dSTejun Heo PERCPU_SECTION(SMP_CACHE_BYTES) 1521b1fbbcaSSam Ravnborg 153*10d7227bSJason Baron#ifdef CONFIG_JUMP_LABEL 154*10d7227bSJason Baron . = ALIGN(PAGE_SIZE); 155*10d7227bSJason Baron .exit.text : { 156*10d7227bSJason Baron EXIT_TEXT 157*10d7227bSJason Baron } 158*10d7227bSJason Baron#endif 159*10d7227bSJason Baron 160bcbe40ebSSam Ravnborg . = ALIGN(PAGE_SIZE); 1611da177e4SLinus Torvalds __init_end = .; 1623240a77bSGeoffrey Thomas BSS_SECTION(0, 0, 0) 1631da177e4SLinus Torvalds _end = . ; 1641b1fbbcaSSam Ravnborg 165d5784b57SDavid S. Miller STABS_DEBUG 166d5784b57SDavid S. Miller DWARF_DEBUG 167023bf6f1STejun Heo 168023bf6f1STejun Heo DISCARDS 1691da177e4SLinus Torvalds} 170