2 * ld script to make ARM Linux kernel
3 * taken from the i386 version by Russell King
4 * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
7 #include <asm-generic/vmlinux.lds.h>
8 #include <asm/thread_info.h>
9 #include <asm/memory.h>
14 #define ARM_EXIT_KEEP(x)
15 #define ARM_EXIT_DISCARD(x) x
22 #define HYPERVISOR_TEXT \
24 * Force the alignment to be compatible with \
25 * the vectors requirements \
28 VMLINUX_SYMBOL(__hyp_idmap_text_start) = .; \
30 VMLINUX_SYMBOL(__hyp_idmap_text_end) = .; \
31 VMLINUX_SYMBOL(__hyp_text_start) = .; \
33 VMLINUX_SYMBOL(__hyp_text_end) = .;
36 * The size of the PE/COFF section that covers the kernel image, which
37 * runs from stext to _edata, must be a round multiple of the PE/COFF
38 * FileAlignment, which we set to its minimum value of 0x200. 'stext'
39 * itself is 4 KB aligned, so padding out _edata to a 0x200 aligned
40 * boundary should be sufficient.
42 PECOFF_FILE_ALIGNMENT = 0x200;
45 #define PECOFF_EDATA_PADDING \
46 .pecoff_edata_padding : { BYTE(0); . = ALIGN(PECOFF_FILE_ALIGNMENT); }
48 #define PECOFF_EDATA_PADDING
54 * XXX: The linker does not define how output sections are
55 * assigned to input sections when there are multiple statements
56 * matching the same input section name. There is no documented
60 ARM_EXIT_DISCARD(EXIT_TEXT)
61 ARM_EXIT_DISCARD(EXIT_DATA)
67 . = PAGE_OFFSET + TEXT_OFFSET;
73 .text : { /* Real text segment */
74 _stext = .; /* Text and read-only data */
75 __exception_text_start = .;
77 __exception_text_end = .;
86 *(.got) /* Global offset table */
92 _etext = .; /* End of text and rodata section */
99 ARM_EXIT_KEEP(EXIT_TEXT)
111 ARM_EXIT_KEEP(EXIT_DATA)
116 . = ALIGN(PAGE_SIZE);
121 __alt_instructions = .;
123 __alt_instructions_end = .;
125 .altinstr_replacement : {
126 *(.altinstr_replacement)
129 . = ALIGN(PAGE_SIZE);
132 RW_DATA_SECTION(64, PAGE_SIZE, THREAD_SIZE)
138 . = ALIGN(PAGE_SIZE);
142 . += SWAPPER_DIR_SIZE;
152 * The HYP init code can't be more than a page long.
154 ASSERT(((__hyp_idmap_text_start + PAGE_SIZE) > __hyp_idmap_text_end),
155 "HYP init code too big")
158 * If padding is applied before .head.text, virt<->phys conversions will fail.
160 ASSERT(_text == (PAGE_OFFSET + TEXT_OFFSET), "HEAD is misaligned")