vmlinux.lds.S 2.6 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
/* ld script to make the Linux/CRIS kernel
 * Authors: Bjorn Wesen (bjornw@axis.com)
 *
 * It is VERY DANGEROUS to fiddle around with the symbols in this
 * script. It is for example quite vital that all generated sections
 * that are used are actually named here, otherwise the linker will
 * put them at the end, where the init stuff is which is FREED after
 * the kernel has booted.
 */

#include <asm-generic/vmlinux.lds.h>
12 13 14 15 16 17 18
#include <asm/page.h>

#ifdef CONFIG_ETRAX_VMEM_SIZE
#define __CONFIG_ETRAX_VMEM_SIZE CONFIG_ETRAX_VMEM_SIZE
#else
#define __CONFIG_ETRAX_VMEM_SIZE 0
#endif
19

20

21 22 23 24 25
jiffies = jiffies_64;
SECTIONS
{
	. = DRAM_VIRTUAL_BASE;
	dram_start = .;
26 27 28
#ifdef CONFIG_ETRAX_ARCH_V10
	ibr_start = .;
#else
29
	ebp_start = .;
30 31
	/* The boot section is only necessary until the VCS top */
	/* level testbench includes both flash and DRAM. */
32
	.boot : { *(.boot) }
33
#endif
34

35
	/* see head.S and pages reserved at the start */
36
	. = DRAM_VIRTUAL_BASE + 0x4000;
37

38 39
	_text = .;			/* Text and read-only data. */
	text_start = .;			/* Lots of aliases. */
40 41 42
	_stext = .;
	__stext = .;
	.text : {
43
		HEAD_TEXT
44
		TEXT_TEXT
45
		SCHED_TEXT
46
		CPUIDLE_TEXT
47 48 49 50 51
		LOCK_TEXT
		*(.fixup)
		*(.text.__*)
	}

52
	_etext = . ;			/* End of text section. */
53 54
	__etext = .;

55
	EXCEPTION_TABLE(4)
56

57
	_sdata = .;
58 59 60 61 62
	RODATA

	. = ALIGN (4);
	___data_start = . ;
	__Sdata = . ;
63
	.data : {			/* Data */
64 65
		CACHELINE_ALIGNED_DATA(32)
		READ_MOSTLY_DATA(32)
M
Mathieu Desnoyers 已提交
66
		DATA_DATA
67
	}
68
	__edata = . ;			/* End of data section. */
69 70
	_edata = . ;

71
	INIT_TASK_DATA_SECTION(PAGE_SIZE)
72

73
	. = ALIGN(PAGE_SIZE);		/* Init code and data. */
74
	__init_begin = .;
75
	INIT_TEXT_SECTION(PAGE_SIZE)
76
	.init.data : { INIT_DATA }
77
	.init.setup : { INIT_SETUP(16) }
78
	.initcall.init : {
79
		INIT_CALLS
80 81 82
	}

	.con_initcall.init : {
83
		CON_INITCALL
84 85 86
	}
	SECURITY_INIT

87 88 89 90 91 92 93 94 95 96
	/* .exit.text is discarded at runtime, not link time,
	 * to deal with references from __bug_table
	 */
	.exit.text : {
		EXIT_TEXT
	}
	.exit.data : {
		EXIT_DATA
	}

97 98 99 100 101 102 103 104 105 106 107
#ifdef CONFIG_ETRAX_ARCH_V10
#ifdef CONFIG_BLK_DEV_INITRD
	.init.ramfs : {
		__initramfs_start = .;
		*(.init.ramfs)
		__initramfs_end = .;
	}
#endif
#endif
	__vmlinux_end = .;		/* Last address of the physical file. */
#ifdef CONFIG_ETRAX_ARCH_V32
108
	PERCPU_SECTION(32)
109 110

	.init.ramfs : {
111
		INIT_RAM_FS
112
	}
113
#endif
114

115 116 117 118 119
	/*
	 * We fill to the next page, so we can discard all init
	 * pages without needing to consider what payload might be
	 * appended to the kernel image.
	 */
120
	. = ALIGN(PAGE_SIZE);
121 122

	__init_end = .;
123

124
	__data_end = . ;		/* Move to _edata ? */
125
	BSS_SECTION(1, 1, 1)
126 127 128 129 130

	. =  ALIGN (0x20);
	_end = .;
	__end = .;

131
	dram_end = dram_start + (CONFIG_ETRAX_DRAM_SIZE - __CONFIG_ETRAX_VMEM_SIZE)*1024*1024;
132 133

	DISCARDS
134
}