blob: 0c1e6783657f26172291186637ea5d20a6966677 [file] [log] [blame]
Sam Ravnborg1b1fbbc2008-11-29 21:44:32 -08001/* ld script for sparc32/sparc64 kernel */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002
3#include <asm-generic/vmlinux.lds.h>
Sam Ravnborgb74e34d2008-12-27 00:34:41 -08004
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -07005#include <asm/page.h>
Sam Ravnborgb74e34d2008-12-27 00:34:41 -08006#include <asm/thread_info.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07007
Sam Ravnborg1b1fbbc2008-11-29 21:44:32 -08008#ifdef CONFIG_SPARC32
9#define INITIAL_ADDRESS 0x10000 + SIZEOF_HEADERS
10#define TEXTSTART 0xf0004000
11
12#define SMP_CACHE_BYTES_SHIFT 5
13
14#else
15#define SMP_CACHE_BYTES_SHIFT 6
16#define INITIAL_ADDRESS 0x4000
17#define TEXTSTART 0x0000000000404000
18
19#endif
20
21#define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT)
22
23#ifdef CONFIG_SPARC32
Linus Torvalds1da177e2005-04-16 15:20:36 -070024OUTPUT_FORMAT("elf32-sparc", "elf32-sparc", "elf32-sparc")
25OUTPUT_ARCH(sparc)
26ENTRY(_start)
27jiffies = jiffies_64 + 4;
Sam Ravnborg1b1fbbc2008-11-29 21:44:32 -080028#else
29/* sparc64 */
30OUTPUT_FORMAT("elf64-sparc", "elf64-sparc", "elf64-sparc")
31OUTPUT_ARCH(sparc:v9a)
32ENTRY(_start)
33jiffies = jiffies_64;
34#endif
35
Linus Torvalds1da177e2005-04-16 15:20:36 -070036SECTIONS
37{
Sam Ravnborg1b1fbbc2008-11-29 21:44:32 -080038 /* swapper_low_pmd_dir is sparc64 only */
39 swapper_low_pmd_dir = 0x0000000000402000;
40 . = INITIAL_ADDRESS;
41 .text TEXTSTART :
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -070042 {
43 _text = .;
Tim Abbottce8a7422009-04-25 22:11:08 -040044 HEAD_TEXT
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -070045 TEXT_TEXT
46 SCHED_TEXT
47 LOCK_TEXT
Sam Ravnborg1b1fbbc2008-11-29 21:44:32 -080048 KPROBES_TEXT
David S. Miller9960e9e2010-04-07 04:41:33 -070049 IRQENTRY_TEXT
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -070050 *(.gnu.warning)
51 } = 0
52 _etext = .;
Sam Ravnborg1b1fbbc2008-11-29 21:44:32 -080053
54 RO_DATA(PAGE_SIZE)
David S. Miller8b8d8e22010-04-09 00:14:35 -070055
56 /* Start of data section */
57 _sdata = .;
58
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -070059 .data1 : {
60 *(.data1)
61 }
Geoffrey Thomas3240a772009-09-18 15:52:09 -040062 RW_DATA_SECTION(SMP_CACHE_BYTES, 0, THREAD_SIZE)
63
Sam Ravnborgb74e34d2008-12-27 00:34:41 -080064 /* End of data section */
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -070065 _edata = .;
Sam Ravnborgb74e34d2008-12-27 00:34:41 -080066
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -070067 .fixup : {
68 __start___fixup = .;
69 *(.fixup)
70 __stop___fixup = .;
71 }
Geoffrey Thomas3240a772009-09-18 15:52:09 -040072 EXCEPTION_TABLE(16)
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -070073 NOTES
74
75 . = ALIGN(PAGE_SIZE);
Geoffrey Thomas3240a772009-09-18 15:52:09 -040076 __init_begin = ALIGN(PAGE_SIZE);
77 INIT_TEXT_SECTION(PAGE_SIZE)
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -070078 __init_text_end = .;
Geoffrey Thomas3240a772009-09-18 15:52:09 -040079 INIT_DATA_SECTION(16)
Jean-Paul Saman67d38222007-02-10 01:44:44 -080080
Sam Ravnborg1b1fbbc2008-11-29 21:44:32 -080081 . = ALIGN(4);
82 .tsb_ldquad_phys_patch : {
83 __tsb_ldquad_phys_patch = .;
84 *(.tsb_ldquad_phys_patch)
85 __tsb_ldquad_phys_patch_end = .;
86 }
87
88 .tsb_phys_patch : {
89 __tsb_phys_patch = .;
90 *(.tsb_phys_patch)
91 __tsb_phys_patch_end = .;
92 }
93
94 .cpuid_patch : {
95 __cpuid_patch = .;
96 *(.cpuid_patch)
97 __cpuid_patch_end = .;
98 }
99
100 .sun4v_1insn_patch : {
101 __sun4v_1insn_patch = .;
102 *(.sun4v_1insn_patch)
103 __sun4v_1insn_patch_end = .;
104 }
105 .sun4v_2insn_patch : {
106 __sun4v_2insn_patch = .;
107 *(.sun4v_2insn_patch)
108 __sun4v_2insn_patch_end = .;
109 }
110
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -0700111 PERCPU(PAGE_SIZE)
Sam Ravnborg1b1fbbc2008-11-29 21:44:32 -0800112
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -0700113 . = ALIGN(PAGE_SIZE);
114 __init_end = .;
Geoffrey Thomas3240a772009-09-18 15:52:09 -0400115 BSS_SECTION(0, 0, 0)
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -0700116 _end = . ;
Sam Ravnborg1b1fbbc2008-11-29 21:44:32 -0800117
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -0700118 STABS_DEBUG
119 DWARF_DEBUG
Tejun Heo023bf6f2009-07-09 11:27:40 +0900120
121 DISCARDS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122}