vmlinux.lds.S 2.7 KB
Newer Older
1
/* ld script for sparc32/sparc64 kernel */
L
Linus Torvalds 已提交
2 3

#include <asm-generic/vmlinux.lds.h>
4

S
Sam Ravnborg 已提交
5
#include <asm/page.h>
6
#include <asm/thread_info.h>
L
Linus Torvalds 已提交
7

8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#ifdef CONFIG_SPARC32
#define INITIAL_ADDRESS  0x10000 + SIZEOF_HEADERS
#define TEXTSTART	0xf0004000

#define SMP_CACHE_BYTES_SHIFT 5

#else
#define SMP_CACHE_BYTES_SHIFT 6
#define INITIAL_ADDRESS 0x4000
#define TEXTSTART      0x0000000000404000

#endif

#define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT)

#ifdef CONFIG_SPARC32
L
Linus Torvalds 已提交
24 25 26 27
OUTPUT_FORMAT("elf32-sparc", "elf32-sparc", "elf32-sparc")
OUTPUT_ARCH(sparc)
ENTRY(_start)
jiffies = jiffies_64 + 4;
28 29 30 31 32 33 34 35
#else
/* sparc64 */
OUTPUT_FORMAT("elf64-sparc", "elf64-sparc", "elf64-sparc")
OUTPUT_ARCH(sparc:v9a)
ENTRY(_start)
jiffies = jiffies_64;
#endif

L
Linus Torvalds 已提交
36 37
SECTIONS
{
38 39 40 41
	/* swapper_low_pmd_dir is sparc64 only */
	swapper_low_pmd_dir = 0x0000000000402000;
	. = INITIAL_ADDRESS;
	.text TEXTSTART :
S
Sam Ravnborg 已提交
42 43
	{
		_text = .;
44
		HEAD_TEXT
S
Sam Ravnborg 已提交
45 46 47
		TEXT_TEXT
		SCHED_TEXT
		LOCK_TEXT
48
		KPROBES_TEXT
49
		IRQENTRY_TEXT
S
Sam Ravnborg 已提交
50 51 52
		*(.gnu.warning)
	} = 0
	_etext = .;
53 54

	RO_DATA(PAGE_SIZE)
D
David S. Miller 已提交
55 56 57 58

	/* Start of data section */
	_sdata = .;

S
Sam Ravnborg 已提交
59 60 61
	.data1 : {
		*(.data1)
	}
62 63
	RW_DATA_SECTION(SMP_CACHE_BYTES, 0, THREAD_SIZE)

64
	/* End of data section */
S
Sam Ravnborg 已提交
65
	_edata = .;
66

S
Sam Ravnborg 已提交
67 68 69 70 71
	.fixup : {
		__start___fixup = .;
		*(.fixup)
		__stop___fixup = .;
	}
72
	EXCEPTION_TABLE(16)
S
Sam Ravnborg 已提交
73 74 75
	NOTES

	. = ALIGN(PAGE_SIZE);
76 77
	__init_begin = ALIGN(PAGE_SIZE);
	INIT_TEXT_SECTION(PAGE_SIZE)
S
Sam Ravnborg 已提交
78
	__init_text_end = .;
79
	INIT_DATA_SECTION(16)
80

81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
	. = ALIGN(4);
	.tsb_ldquad_phys_patch : {
		__tsb_ldquad_phys_patch = .;
		*(.tsb_ldquad_phys_patch)
		__tsb_ldquad_phys_patch_end = .;
	}

	.tsb_phys_patch : {
		__tsb_phys_patch = .;
		*(.tsb_phys_patch)
		__tsb_phys_patch_end = .;
	}

	.cpuid_patch : {
		__cpuid_patch = .;
		*(.cpuid_patch)
		__cpuid_patch_end = .;
	}

	.sun4v_1insn_patch : {
		__sun4v_1insn_patch = .;
		*(.sun4v_1insn_patch)
		__sun4v_1insn_patch_end = .;
	}
	.sun4v_2insn_patch : {
		__sun4v_2insn_patch = .;
		*(.sun4v_2insn_patch)
		__sun4v_2insn_patch_end = .;
	}
110 111 112 113 114
	.leon_1insn_patch : {
		__leon_1insn_patch = .;
		*(.leon_1insn_patch)
		__leon_1insn_patch_end = .;
	}
115 116 117 118 119 120 121 122 123 124
	.swapper_tsb_phys_patch : {
		__swapper_tsb_phys_patch = .;
		*(.swapper_tsb_phys_patch)
		__swapper_tsb_phys_patch_end = .;
	}
	.swapper_4m_tsb_phys_patch : {
		__swapper_4m_tsb_phys_patch = .;
		*(.swapper_4m_tsb_phys_patch)
		__swapper_4m_tsb_phys_patch_end = .;
	}
125 126 127 128 129
	.popc_3insn_patch : {
		__popc_3insn_patch = .;
		*(.popc_3insn_patch)
		__popc_3insn_patch_end = .;
	}
130 131 132 133 134
	.popc_6insn_patch : {
		__popc_6insn_patch = .;
		*(.popc_6insn_patch)
		__popc_6insn_patch_end = .;
	}
135 136 137 138
	.pause_3insn_patch : {
		__pause_3insn_patch = .;
		*(.pause_3insn_patch)
		__pause_3insn_patch_end = .;
139
	}
140
	PERCPU_SECTION(SMP_CACHE_BYTES)
141

S
Sam Ravnborg 已提交
142 143
	. = ALIGN(PAGE_SIZE);
	__init_end = .;
144
	BSS_SECTION(0, 0, 0)
S
Sam Ravnborg 已提交
145
	_end = . ;
146

S
Sam Ravnborg 已提交
147 148
	STABS_DEBUG
	DWARF_DEBUG
149 150

	DISCARDS
L
Linus Torvalds 已提交
151
}