Files
2024-06-17 20:18:01 +08:00

65 lines
1.0 KiB
Plaintext

/* SPDX-License-Identifier: GPL-2.0 */
/*
* ld.script for compressed kernel support of LoongArch
*
* Author: Huacai Chen <chenhuacai@loongson.cn>
* 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)
*(.rodata)
}: text
/* End of text section */
. = ALIGN(PECOFF_SEGMENT_ALIGN);
_data = .;
/* Writable data */
.data : {
*(.data)
/* Put the compressed image here */
__image_begin = .;
*(.image)
__image_end = .;
CONSTRUCTORS
. = ALIGN(PECOFF_FILE_ALIGN);
}
_edata = .;
/* End of data section */
/* BSS */
.bss : {
*(.bss)
}
. = ALIGN(PECOFF_SEGMENT_ALIGN);
_end = .;
/* Sections to be discarded */
/DISCARD/ : {
*(.options)
*(.comment)
*(.note)
}
}