/* SPDX-License-Identifier: GPL-2.0 */ /* * ld.script for compressed kernel support of LoongArch * * Author: Huacai Chen * Copyright (C) 2020 Loongson Technology Corporation Limited */ /* * Max avaliable Page Size is 64K, so we set SectionAlignment * field of EFI application to 64K. */ PECOFF_FILE_ALIGN = 0x200; PECOFF_SEGMENT_ALIGN = 0x10000; OUTPUT_ARCH(loongarch) ENTRY(start) PHDRS { text PT_LOAD FLAGS(7); /* RWX */ } SECTIONS { /* Text and read-only data */ _text = .; .head.text : { *(.head.text) } .text : { *(.text) *(.init.text) *(.rodata) }: text /* End of text section */ . = ALIGN(PECOFF_SEGMENT_ALIGN); _data = .; /* Writable data */ .data : { *(.data) *(.init.data) /* Put the compressed image here */ __image_begin = .; *(.image) __image_end = .; CONSTRUCTORS . = ALIGN(PECOFF_FILE_ALIGN); } _edata = .; /* End of data section */ /* BSS */ .bss : { *(.bss) *(.init.bss) } . = ALIGN(PECOFF_SEGMENT_ALIGN); _end = .; /* Sections to be discarded */ /DISCARD/ : { *(.options) *(.comment) *(.note) } }