[PATCH] firmware: Prevent _start from not being at the beginning

Xiang W wxjstz at 126.com
Tue Mar 5 02:31:03 PST 2024


There are multiple .entry sections in opensbi, and _start may be put
after other .entry sections, which may cause problems. The patch fix
this issue.

Signed-off-by: Xiang W <wxjstz at 126.com>
---
 firmware/fw_base.S   | 2 +-
 firmware/fw_base.ldS | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/firmware/fw_base.S b/firmware/fw_base.S
index 09894e6..7ade6a5 100644
--- a/firmware/fw_base.S
+++ b/firmware/fw_base.S
@@ -42,7 +42,7 @@
 999:
 .endm
 
-	.section .entry, "ax", %progbits
+	.section .entry0, "ax", %progbits
 	.align 3
 	.globl _start
 	.globl _start_warm
diff --git a/firmware/fw_base.ldS b/firmware/fw_base.ldS
index fb47984..c1dc743 100644
--- a/firmware/fw_base.ldS
+++ b/firmware/fw_base.ldS
@@ -18,6 +18,7 @@
 	.text :
  	{
 		PROVIDE(_text_start = .);
+		*(.entry0)
 		*(.entry)
 		*(.text)
 		. = ALIGN(8);
-- 
2.43.0




More information about the opensbi mailing list