mirror of
https://gitee.com/open-loongarch/linux-5.10.git
synced 2026-10-28 22:17:12 +08:00
65 lines
1.0 KiB
Plaintext
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)
|
|
}
|
|
}
|