[PATCH 12/17] bsp/riscv: Load global pointer

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Jun 22 11:59:09 UTC 2018


Update #3433.
---
 bsps/riscv/riscv/start/start.S | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/bsps/riscv/riscv/start/start.S b/bsps/riscv/riscv/start/start.S
index ae45de4876..1f6b3f96f5 100644
--- a/bsps/riscv/riscv/start/start.S
+++ b/bsps/riscv/riscv/start/start.S
@@ -46,6 +46,12 @@ PUBLIC(_start)
 	.section	.bsp_start_text, "ax", @progbits
 TYPE_FUNC(_start)
 SYM(_start):
+	/* Load global pointer */
+	.option	push
+	.option	norelax
+	la	gp, __global_pointer$
+	.option	pop
+
 	la	t0, ISR_Handler
 	csrw	mtvec, t0
 
-- 
2.13.7




More information about the devel mailing list