From 4c1137a10788169429637cebcdaf5060c71e8b4b Mon Sep 17 00:00:00 2001 From: WangRunji Date: Sat, 7 Jul 2018 16:21:08 +0800 Subject: [PATCH] Make sure `kern_entry` at the beginning. --- src/arch/riscv32/boot/entry.asm | 4 ++-- src/arch/riscv32/boot/linker.ld | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/arch/riscv32/boot/entry.asm b/src/arch/riscv32/boot/entry.asm index 3079c9f6..57f5cbf3 100644 --- a/src/arch/riscv32/boot/entry.asm +++ b/src/arch/riscv32/boot/entry.asm @@ -1,10 +1,10 @@ - .section .text,"ax",%progbits + .section .entry .globl kern_entry kern_entry: la sp, bootstacktop tail rust_main -.section .data + .section .data .align 12 #PGSHIFT .global bootstack bootstack: diff --git a/src/arch/riscv32/boot/linker.ld b/src/arch/riscv32/boot/linker.ld index 3f6f7657..5edaf2a6 100644 --- a/src/arch/riscv32/boot/linker.ld +++ b/src/arch/riscv32/boot/linker.ld @@ -14,7 +14,8 @@ SECTIONS . = BASE_ADDRESS; .text : { - *(.text.kern_entry .text .stub .text.* .gnu.linkonce.t.*) + *(.entry) + *(.text .stub .text.* .gnu.linkonce.t.*) } PROVIDE(etext = .); /* Define the 'etext' symbol to this value */