blob: c4f5758c9dc7753b5f4aa9ab75f9adbc4def7631 [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)
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -070055 .data1 : {
56 *(.data1)
57 }
Geoffrey Thomas3240a772009-09-18 15:52:09 -040058 RW_DATA_SECTION(SMP_CACHE_BYTES, 0, THREAD_SIZE)
59
Sam Ravnborgb74e34d2008-12-27 00:34:41 -080060 /* End of data section */
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -070061 _edata = .;
Sam Ravnborgb74e34d2008-12-27 00:34:41 -080062
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -070063 .fixup : {
64 __start___fixup = .;
65 *(.fixup)
66 __stop___fixup = .;
67 }
Geoffrey Thomas3240a772009-09-18 15:52:09 -040068 EXCEPTION_TABLE(16)
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -070069 NOTES
70
71 . = ALIGN(PAGE_SIZE);
Geoffrey Thomas3240a772009-09-18 15:52:09 -040072 __init_begin = ALIGN(PAGE_SIZE);
73 INIT_TEXT_SECTION(PAGE_SIZE)
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -070074 __init_text_end = .;
Geoffrey Thomas3240a772009-09-18 15:52:09 -040075 INIT_DATA_SECTION(16)
Jean-Paul Saman67d38222007-02-10 01:44:44 -080076
Sam Ravnborg1b1fbbc2008-11-29 21:44:32 -080077 . = ALIGN(4);
78 .tsb_ldquad_phys_patch : {
79 __tsb_ldquad_phys_patch = .;
80 *(.tsb_ldquad_phys_patch)
81 __tsb_ldquad_phys_patch_end = .;
82 }
83
84 .tsb_phys_patch : {
85 __tsb_phys_patch = .;
86 *(.tsb_phys_patch)
87 __tsb_phys_patch_end = .;
88 }
89
90 .cpuid_patch : {
91 __cpuid_patch = .;
92 *(.cpuid_patch)
93 __cpuid_patch_end = .;
94 }
95
96 .sun4v_1insn_patch : {
97 __sun4v_1insn_patch = .;
98 *(.sun4v_1insn_patch)
99 __sun4v_1insn_patch_end = .;
100 }
101 .sun4v_2insn_patch : {
102 __sun4v_2insn_patch = .;
103 *(.sun4v_2insn_patch)
104 __sun4v_2insn_patch_end = .;
105 }
106
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -0700107 PERCPU(PAGE_SIZE)
Sam Ravnborg1b1fbbc2008-11-29 21:44:32 -0800108
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -0700109 . = ALIGN(PAGE_SIZE);
110 __init_end = .;
Geoffrey Thomas3240a772009-09-18 15:52:09 -0400111 BSS_SECTION(0, 0, 0)
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -0700112 _end = . ;
Sam Ravnborg1b1fbbc2008-11-29 21:44:32 -0800113
Sam Ravnborgbcbe40e2007-09-17 19:02:30 -0700114 STABS_DEBUG
115 DWARF_DEBUG
Tejun Heo023bf6f2009-07-09 11:27:40 +0900116
117 DISCARDS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118}