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);
57 * struct alt_inst entries. From the header (alternative.h):
58 * "Alternative instructions for different CPU types or capabilities"
59 * Think locking instructions on spinlocks.
62 .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
63 __alt_instructions = .;
65 __alt_instructions_end = .;
68 #ifdef CONFIG_RELOCATABLE
70 .la_abs : AT(ADDR(.la_abs) - LOAD_OFFSET) {
77 .got : ALIGN(16) { *(.got) }
78 .plt : ALIGN(16) { *(.plt) }
79 .got.plt : ALIGN(16) { *(.got.plt) }
81 .data.rel : { *(.data.rel*) }
83 . = ALIGN(PECOFF_SEGMENT_ALIGN);
87 INIT_TEXT_SECTION(PAGE_SIZE)
92 . = ALIGN(PECOFF_SEGMENT_ALIGN);
103 PERCPU_SECTION(1 << CONFIG_L1_CACHE_SHIFT)
109 . = ALIGN(PECOFF_SEGMENT_ALIGN);
116 RW_DATA(1 << CONFIG_L1_CACHE_SHIFT, PAGE_SIZE, THREAD_SIZE)
118 .rela.dyn : ALIGN(8) {
119 __rela_dyn_begin = .;
120 *(.rela.dyn) *(.rela*)
127 .edata_padding : { BYTE(0); . = ALIGN(PECOFF_FILE_ALIGN); }
130 BSS_SECTION(0, SZ_64K, 8)
131 . = ALIGN(PECOFF_SEGMENT_ALIGN);
150 *(.dynamic .dynsym .dynstr .hash .gnu.hash)