1 /* SPDX-License-Identifier: GPL-2.0 */
2 #include <linux/sizes.h>
3 #include <asm/asm-offsets.h>
4 #include <asm/thread_info.h>
6 #define PAGE_SIZE _PAGE_SIZE
7 #define RO_EXCEPTION_TABLE_ALIGN 4
10 * Put .bss..swapper_pg_dir as the first thing in .bss. This will
11 * ensure that it has .bss alignment (64K).
13 #define BSS_FIRST_SECTIONS *(.bss..swapper_pg_dir)
15 #include <asm-generic/vmlinux.lds.h>
16 #include "image-vars.h"
19 * Max avaliable Page Size is 64K, so we set SectionAlignment
20 * field of EFI application to 64K.
22 PECOFF_FILE_ALIGN = 0x200;
23 PECOFF_SEGMENT_ALIGN = 0x10000;
25 OUTPUT_ARCH(loongarch)
28 text PT_LOAD FLAGS(7); /* RWX */
29 note PT_NOTE FLAGS(4); /* R__ */
36 . = VMLINUX_LOAD_ADDRESS;
41 . = ALIGN(PECOFF_SEGMENT_ALIGN);
53 . = ALIGN(PECOFF_SEGMENT_ALIGN);
56 . = ALIGN(PECOFF_SEGMENT_ALIGN);
60 INIT_TEXT_SECTION(PAGE_SIZE)
65 . = ALIGN(PECOFF_SEGMENT_ALIGN);
71 * struct alt_inst entries. From the header (alternative.h):
72 * "Alternative instructions for different CPU types or capabilities"
73 * Think locking instructions on spinlocks.
76 .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
77 __alt_instructions = .;
79 __alt_instructions_end = .;
88 PERCPU_SECTION(1 << CONFIG_L1_CACHE_SHIFT)
94 . = ALIGN(PECOFF_SEGMENT_ALIGN);
102 .got : ALIGN(16) { *(.got) }
103 .plt : ALIGN(16) { *(.plt) }
104 .got.plt : ALIGN(16) { *(.got.plt) }
106 RW_DATA(1 << CONFIG_L1_CACHE_SHIFT, PAGE_SIZE, THREAD_SIZE)
108 .rela.dyn : ALIGN(8) {
109 __rela_dyn_begin = .;
110 *(.rela.dyn) *(.rela*)
114 .data.rel : { *(.data.rel*) }
116 #ifdef CONFIG_RELOCATABLE
118 .la_abs : AT(ADDR(.la_abs) - LOAD_OFFSET) {
128 .edata_padding : { BYTE(0); . = ALIGN(PECOFF_FILE_ALIGN); }
131 BSS_SECTION(0, SZ_64K, 8)
132 . = ALIGN(PECOFF_SEGMENT_ALIGN);
140 #ifdef CONFIG_EFI_STUB
142 _kernel_asize = _end - _text;
143 _kernel_fsize = _edata - _text;
144 _kernel_vsize = _end - __initdata_begin;
145 _kernel_rsize = _edata - __initdata_begin;
146 _kernel_offset = kernel_offset - _text;
160 *(.dynamic .dynsym .dynstr .hash .gnu.hash)