blob: 4e599259396747947c2145e7023cf311636b65d2 [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
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -070049 *(.gnu.warning)
50 } = 0
51 _etext = .;
Sam Ravnborg1b1fbbc2008-11-29 21:44:32 -080052
53 RO_DATA(PAGE_SIZE)
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -070054 .data1 : {
55 *(.data1)
56 }
Geoffrey Thomas3240a772009-09-18 15:52:09 -040057 RW_DATA_SECTION(SMP_CACHE_BYTES, 0, THREAD_SIZE)
58
Sam Ravnborgb74e34d2008-12-27 00:34:41 -080059 /* End of data section */
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -070060 _edata = .;
Sam Ravnborgb74e34d2008-12-27 00:34:41 -080061
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -070062 .fixup : {
63 __start___fixup = .;
64 *(.fixup)
65 __stop___fixup = .;
66 }
Geoffrey Thomas3240a772009-09-18 15:52:09 -040067 EXCEPTION_TABLE(16)
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -070068 NOTES
69
70 . = ALIGN(PAGE_SIZE);
Geoffrey Thomas3240a772009-09-18 15:52:09 -040071 __init_begin = ALIGN(PAGE_SIZE);
72 INIT_TEXT_SECTION(PAGE_SIZE)
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -070073 __init_text_end = .;
Geoffrey Thomas3240a772009-09-18 15:52:09 -040074 INIT_DATA_SECTION(16)
Jean-Paul Saman67d38222007-02-10 01:44:44 -080075
Sam Ravnborg1b1fbbc2008-11-29 21:44:32 -080076 . = ALIGN(4);
77 .tsb_ldquad_phys_patch : {
78 __tsb_ldquad_phys_patch = .;
79 *(.tsb_ldquad_phys_patch)
80 __tsb_ldquad_phys_patch_end = .;
81 }
82
83 .tsb_phys_patch : {
84 __tsb_phys_patch = .;
85 *(.tsb_phys_patch)
86 __tsb_phys_patch_end = .;
87 }
88
89 .cpuid_patch : {
90 __cpuid_patch = .;
91 *(.cpuid_patch)
92 __cpuid_patch_end = .;
93 }
94
95 .sun4v_1insn_patch : {
96 __sun4v_1insn_patch = .;
97 *(.sun4v_1insn_patch)
98 __sun4v_1insn_patch_end = .;
99 }
100 .sun4v_2insn_patch : {
101 __sun4v_2insn_patch = .;
102 *(.sun4v_2insn_patch)
103 __sun4v_2insn_patch_end = .;
104 }
105
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -0700106 PERCPU(PAGE_SIZE)
Sam Ravnborg1b1fbbc2008-11-29 21:44:32 -0800107
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -0700108 . = ALIGN(PAGE_SIZE);
109 __init_end = .;
Geoffrey Thomas3240a772009-09-18 15:52:09 -0400110 BSS_SECTION(0, 0, 0)
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -0700111 _end = . ;
Sam Ravnborg1b1fbbc2008-11-29 21:44:32 -0800112
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -0700113 STABS_DEBUG
114 DWARF_DEBUG
Tejun Heo023bf6f2009-07-09 11:27:40 +0900115
116 DISCARDS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117}