qemu-cr16/tests/tcg/loongarch64/system/kernel.ld
Bibo Mao 73047c825e hw/loongarch/virt: Get physical entry address with elf file
With load_elf() api, image load low address and high address is converted
to physical address if parameter translate_fn is provided. However
executing entry address is still virtual address. Here convert entry
address into physical address, since MMU is disabled when system power on,
the first PC instruction should be physical address.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Song Gao <gaosong@loongson.cn>
2025-05-06 09:17:32 +08:00

30 lines
386 B
Text

ENTRY(_start)
SECTIONS
{
/* Linux kernel legacy start address. */
. = 0x200000;
_text = .;
.text : {
*(.text)
}
.rodata : {
*(.rodata)
}
_etext = .;
. = ALIGN(8192);
_data = .;
.got : {
*(.got)
}
.data : {
*(.sdata)
*(.data)
}
_edata = .;
.bss : {
*(.bss)
}
_end = .;
}